Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
sreepathy1104
New Member

Background color for entire table based on value

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.

2 REPLIES 2
olgad
Super User
Super User

Hi @sreepathy1104 , just wanted to follow up if the solution provided worked?


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime
olgad
Super User
Super User

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


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors