Forum Discussion
Traffic light KPI with an threshold input
Hi @MFelix ,
thanks for your Answer, I can work with that.
Why is there a need to disconnect the tables to grab the values?
BR
You only will need a disconnected table if you want to have single measure for the condittional formatting.
What I mean is that assume you want to have this measure:
Condittional formatting =
SWITCH (
TRUE ();
SUM ( Table[ABC] ) < 1000; "Red";
SUM ( Table[ABC] ) >= 1000
&& SUM ( Table[ABC] ) >= 2000; "Yellow";
SUM ( Table[ABC] ) < 2000; "Green";
SUM ( Table[ZYX] ) < 1000; "Red";
SUM ( Table[ZYX] ) >= 1000
&& SUM ( Table[ZYX] ) >= 2000; "Yellow";
SUM ( Table[ZYX] ) < 2000; "Green"
)
If you use the same table to get the values since you have column ABC and columnZYX in the same table the calculations are picking up the first column you place on the switch measure in this case column ABC so the result would be to have a line with all values equal. In this case you would need to have the disconnected table making the specification that calculations for column ABC would only pick up the column ABC.
- Anonymous5 years agoNot applicable
Hey Miguel,
thanks again for your fast response.
Since I want to use the outcome of the measures for diagrams (e.g. a bar chart), I wonder if I can use those measures, beacuse PowerBI asks for values. So I can't drop this measures in the field value because they contain words and not values ....
I'd like to exhibit the overall amount of the green, yellow and red values ...What would you suggest?
BR
- MFelix5 years ago
Super User
Hi Anonymous ,
The measure can be used in any condittional formatting, since when making the use of colours it identifies the Red, Green and Yellow and converts it to colour coding.
however if you want you can customize the colour by adding the HEX codes of your choice you just need to replace the "Red" by "#FFFFFF" the codes must always have the # and 6 characters.
- Anonymous5 years agoNot applicable
Hi Miguel,
thanks to your suggestions I was able to create a measure that contains the colors as words.
Unfortunately I can't use it in diagrams, it only allows me to drag & drop the measure in the quickinfo field. Also the conditional formating option doesn't allow to select this measure ....
I also tried to calculate these colors directly in the table as new column. This works fine and it ca be shown in a diagram, because Power BI can count the amount of greens, yellows or reds.
I'd prefer the measure solution, but I can't find the right way to do it. Can you give me any other suggestions?
BR