Power BI - 如果不符合条件,是否可以有条件地格式化文本列?

Power BI - Is there a way to conditionally format a text column if it does NOT meet a criteria?

如标题所述,如果文本列不符合条件 - 在 Power BI 中,是否有一种方法可以有条件地设置文本列的格式?

即:格式化列的字体颜色,如果它不是 "x"。

例如:

我想格式化以下数据(使用字母列)并突出显示 a、b 和 c(因为它们不等于 x)

ID | code | letter
------------------
1  | 123  | a
2  | 345  | b
3  | 567  | x
4  | 789  | c
------------------

您始终可以创建一个度量来确定所需的突出显示颜色,并使用它,例如像这样:

Measure = If(FIRSTNONBLANK('Table'[letter]; [letter]) = "x"; BLANK(); "#AABBCC")

Color formatting by field value:

You can use a measure or a column that specifics a color, either using a text value or a hex code, to apply that color to the background of font color of a table or matrix visual. You can also create custom logic for a given field, and have that logic apply the desired color to the font or background.

你没有提到你想强调什么以及如何强调。如果数据不会聚合并显示 table 中的所有行,您可以在 Power Query 编辑器或计算列 (DAX) 中计算条件列中的突出显示颜色。如果突出显示规则将应用于聚合数据,那么您应该使用 DAX 度量。

如果要突出显示单元格,return 所需的颜色。否则,在 Power Query 编辑器中 return null,或在 DAX 中 BLANK()