Forum Discussion
daniellamoore29
2 years agoHelper I
Gauge visual conditional formatting
Hi, I have a table with 1. 'target deadline' which is the overall financial year target i.e., 500 for the 4 quarters 2. 'Target' for each quarter i.e., 125 every quarter 3. 'Metric value' for e...
- 2 years ago
daniellamoore29 Try this. PBIX is attached below signature.
Measure = VAR __Target = SUM('Table'[Target]) VAR __Metric = SUM('Table'[Metric Value]) VAR __Variance = SUM('Table'[Variance Threshold]) VAR __Result = SWITCH( TRUE(), __Metric < __Variance, "Red", __Metric < __Target, "Yellow", "Green" ) RETURN __Result
daniellamoore29
2 years agoHelper I
Greg_Deckler how can I add the measure to the field value conditional formatting please? I am unable to change the meausre to text data type, it doesn't give me the option which other forums have said resolves the issue?
- Greg_Deckler2 years agoCommunity Champion
daniellamoore29 This is what I did in the PBIX file (below). Not sure what issue you are having. If you want to use hex codes, you need to make sure your measure returns those as text, like "#FF0000" I believe.
Measure = VAR __Target = SUM('Table'[Target]) VAR __Metric = SUM('Table'[Metric Value]) VAR __Variance = SUM('Table'[Variance Threshold]) VAR __Result = SWITCH( TRUE(), __Metric < __Variance, "#FF0000", __Metric < __Target, "Yellow", "#00FF00" ) RETURN __Result