Power Bi表单元格的条件格式

时间:2020-04-17 09:36:04

标签: excel switch-statement google-visualization powerbi dax

我有一张功率bi产品表。它有一个称为sales rate的列。它的文本值是“ high,medium,low”。我想为其添加条件格式。如果为高,则单元格的背景应为红色;如果为中等,则单元格的背景应为黄色;否则为绿色。我该怎么办?可以在文本中使用切换功能吗?

1 个答案:

答案 0 :(得分:1)

您可以创建一个新列,如下所示:

Column = SWITCH('Table'[Sales rate]; "high"; "red"; "medium"; "yellow"; "low"; "green")

然后右键单击“可视化效果”窗格中的每个字段,然后选择Conditional formatting-> Background color

enter image description here

根据创建的列,通过Field value对其进行格式化,并进行First汇总,您将获得所需的突出显示:

enter image description here

有关更多信息,请参见Use conditional formatting in tables