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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors