我正在使用Power Bi Desktop并尝试在表格视觉上进行条件格式设置,因此我必须创建多个计算出的度量值,例如从KPI数据表中获得红色,琥珀色,绿色和ColourFlag度量值以连接到成功百分比度量值(条件格式)。基于5个不同的成功措施,这意味着我必须做5次(20个措施)。我不知道如何在较短的时间内做到这一点。
我有一个KPI表-它具有4个字段-度量,红色,琥珀色,绿色。 度量字段具有从Measure1到Measure5的示例简短说明R = 79.9,M1的A = 80.0 G = 90,M2的R = 88.9,A = 89.0 G = 98.0(基于5个度量表)
//Green = CALCULATE(max('KPI DATA'[Green]),FILTER(ALL('KPI DATA'),'KPI DATA'[Field Type] = "Success %"))
//Amber = CALCULATE(max('KPI DATA'[Amber]),FILTER(ALL('KPI DATA'),'KPI DATA'[Field Type] = "Success %"))
//Red= CALCULATE(max('KPI DATA'[Red]),FILTER(ALL('KPI DATA'),'KPI DATA'[Field Type] = "Success %"))
ColourFlagM1 = IF(Measure1] * 100 >= CALCULATE(max('KPI DATA'[Green]),FILTER(ALL('KPI DATA'),'KPI DATA'[Field Type] = "Success %")),1,IF([Measure1] * 100 <CALCULATE(max('KPI DATA'[Green]),FILTER(ALL('KPI DATA'),'KPI DATA'[Field Type] = "Success %")) && [Measure1] * 100>CALCULATE(max('KPI DATA'[Amber]),FILTER(ALL('KPI DATA'),'KPI DATA'[Field Type] = "Success %")),2, IF([Measure1] * 100 <=CALCULATE(max('KPI DATA'[Red]),FILTER(ALL('KPI DATA'),'KPI DATA'[Field Type] = "Success %")) ,3)))
Within Power bi Clicking on Table - format - Conditional formatting -Select [Measure1] - Background Color -Advance controls - Format by Rules -Based on Field [ColourFlag] if value is 1 then Green - Add - ok
预期目标是减少措施,减少数量。