Forum Discussion
Creating Conditional color format based on a changing measure
- 6 years ago
nmyre - First, I would write your measure like this:
Color = VAR O = [%Ob] VAR TSL = [TSL%] RETURN SWITCH(TRUE(), O <= TSL - .05,1, O > TSL - .05 && O < TSL +.05,2, O <=TSL + .05,3, 4 )Then you would do this:
I attached an example PBIX below sig. Page 8, Table 8.
- 6 years ago
nmyre - Yes, so in the example I attached, my "Color" measure was called "Measure 5". I set the conditional formatting on "Measure 3", using "Measure 5" as the basis for my rules.
So, in your case, you want to click the down arrow in the Visuals area not on %ObC but on your other measure, %Ob, which you want the color on and choose Conditional Formatting | Background Color. Then choose Rules. Then choose your Color measure and then setup your rules.
Hope that clears things up.
nmyre - First, I would write your measure like this:
Color =
VAR O = [%Ob]
VAR TSL = [TSL%]
RETURN
SWITCH(TRUE(),
O <= TSL - .05,1,
O > TSL - .05 && O < TSL +.05,2,
O <=TSL + .05,3,
4
)
Then you would do this:
I attached an example PBIX below sig. Page 8, Table 8.
Thank you for your response. I am close but not quite there. I feel as if I am missing something simple. Here is my Measure:
Here is my output:
The colors are correct for the adjacent value, but what I am looking for is the percentages inside the color cells. Example:
Any Ideas?
- Greg_Deckler6 years agoCommunity Champion
nmyre - Yes, so in the example I attached, my "Color" measure was called "Measure 5". I set the conditional formatting on "Measure 3", using "Measure 5" as the basis for my rules.
So, in your case, you want to click the down arrow in the Visuals area not on %ObC but on your other measure, %Ob, which you want the color on and choose Conditional Formatting | Background Color. Then choose Rules. Then choose your Color measure and then setup your rules.
Hope that clears things up.
- nmyre6 years agoHelper III
And there it is! Very Good. Thank you.
- Greg_Deckler6 years agoCommunity Champion
nmyre - Awesome! Yeah it's all easy once you know the trick!! But getting there is not necessarily super intuitive! 🙂