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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Peter_2020
Helper III
Helper III

Conditional formatting based on value in another column

Hi all, 

I would like to ask you for help with following issue:

 

I have the table with 3 columns:

CATEGORYTARGETPERFORMANCE
1110%109%
2115%110%
3130%140%

 

And I need to somehow define the rules for conditional formatting (or other formatting) that if the performance of category 1,2 or 3 is lower than target in the same line put the cells background to red and if the performance of category 1,2 or 3 is higher than target put it green. Expected result is shown here:

 

CATEGORYTARGETPERFORMANCE
1110%109% (red background)
2115%110% (red background)
3130%140% (green background)

 

Thanks in advance for your help!

P

1 ACCEPTED SOLUTION

@Peter_2020 , Try like

 

if(max(table[PERFORMANCE]) <Max(Table[TARGET]) , "Red", "Green")

 

or

 

if(average(table[PERFORMANCE]) <average(Table[TARGET]) , "Red", "Green")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Peter_2020 , Assuming [PERFORMANCE] and [TARGET] are measures

 

then create a color measure and use that in conditional formatting with field value option

 

if([PERFORMANCE] <[TARGET] , "Red", "Green")

 

refer for step

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Performance and Target are columns from imported excel table...

@Peter_2020 , Try like

 

if(max(table[PERFORMANCE]) <Max(Table[TARGET]) , "Red", "Green")

 

or

 

if(average(table[PERFORMANCE]) <average(Table[TARGET]) , "Red", "Green")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, 

I'm new to Power bi. 

Where are you inserting the "if" statement into?

Thanks.

 

It works!!! Thank you very much!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.