Forum Discussion
Conditional formatting based on another table
Hello NOVICE02
Conditional formatting sometimes is tricky in Power BI, especially when you want to involve multiple tables.
There could be multiple ways of doing it, but the way I do it is by creating a measure for defining the color:
Color AHT =
SWITCH (
TRUE (),
ISBLANK ( [tgt AHT] ), "#C0C0C0",
[Avg Handle Time] <= [tgt AHT], "#008000",
[Avg Handle Time] > [tgt AHT], "#f08080"
)
In the example above, I am comparing two measures: [Avg Handle Time] against [Aht target] which are in two separate tables.
Once this measure is created, apply the following steps in conditional formatting :
Format by > Field Value
Then select the measure created above:
Regards,
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
it didn't work... I wrote a measure to test like this:
- vivran226 years agoCommunity Champion
I am not sure how you are applying it. I have used the same formula and it is working for me:
Can you share more details on this?
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
Connect on LinkedIn- NOVICE026 years agoHelper III
Once I write the measure.. I choose the able and select var. penetration... which is the measure defined in:
Live_pen =
SWITCH (TRUE (),ISBLANK ( [% out_liv_pen_var] ), "#BBE4EC",[% out_liv_pen_var] < 0 , "#DA291C" ,[% out_liv_pen_var] = 0 ,"#FFBF3F",[% out_liv_pen_var] > 0, "#00B050")From conditional formatting i select format by field value and choose the measure that i created and click ok...
and nothing... am i missing a step ?
- vivran226 years agoCommunity Champion
You have followed all the steps, but still not getting the desired result. Is it possible to share the pbix file with the sample data?
Cheers!
Vivek
https://www.vivran.in/
Connect on LinkedIn