Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
How to do conditional formatting to change background color for power bi table based on values.
So, we can do the conditional formatting for each column. But my table contains around 15 columns so instead of doing it manually I'm looking for a efficient way. The criteria is if my value is <= 20, then background color should be red.
Hi @sreepathy1104 , just wanted to follow up if the solution provided worked?
Hi, if you create a table with 2 columns , 1 would have the names of your 15 columns, the other would have the index.
name index
Sales 1
Costs 2
%Growth 3 etc
Then create only one measure
Switch(max(index),
1, Sum(Sales),
2, Sum(Costs),
3, Divide(Sum(Sales)-Sum(Costs), Sum(Costs))
Since you already have those 15 calculated, you can just plug in those measures instead of calculations.
Switch(max(index),
1, Total Sales,
2, Total Costs,
3, %Growth)
Place the
names onto the columns, this one measure onto the values and then you have just this one measure to apply conditional formatting to.
if needed different formats % and absolute, then work with the word FORMAT
User | Count |
---|---|
86 | |
82 | |
68 | |
64 | |
55 |
User | Count |
---|---|
123 | |
100 | |
90 | |
83 | |
66 |