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! Learn more

Reply
harib
Post Patron
Post Patron

Conditional background color based on the other column

Hello Friends,

 

Is it possible to create background color for column based on the other column  like below table.

I have a Target and Performance column. Based on the Target ,performance column background should come.

Condition : if Performance > Target Green should come and if Performance < Target Red should come.

 

Target    Performace

75%         30%

85%        90%

65%        70%

 

Thanks in advance

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

So, the easiest way to do this would be to create a measure like:

 

Indicator = 
VAR __target = MAX('Table'[Target])
VAR __performance = MAX('Table'[Performance])
RETURN
IF(__performance < __target,"Red","Green")

Then you can base your conditional formatting off of that measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Mariusz
Community Champion
Community Champion

Hi @harib 

 

Yes, you can do the following.

Create a measure like below, you can replace my sum aggregation with Measures.

Conditional Formatting = 
INT( SUM( YourTable[Performance] ) > SUM( YourTable[Target] ) 

In table visual, under Filters > Values, right click on the field you want to apply the formatting on and go to Conditional formatting > Background color.

image.png

Nesxt, make sure you set everything as on the screenshot below.

image.png

Let me know if you ned any extra help

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

 

 

 

@Mariusz 

 

Hi Mariusz,

Forgot to inform you . Performance is a measure. It's not a column. Output  is not coming

If both are columns then it's working superb.

 

Can u please look into that .Thanks in advance

 

Thanks

Mariusz
Community Champion
Community Champion

Hi @harib 

Please see the below Measure adjusted for use with Measure, the rest is the same as previous post.

Conditional Formatting = 
INT( [Performance]  > [Target] ) 
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski


 

Greg_Deckler
Community Champion
Community Champion

So, the easiest way to do this would be to create a measure like:

 

Indicator = 
VAR __target = MAX('Table'[Target])
VAR __performance = MAX('Table'[Performance])
RETURN
IF(__performance < __target,"Red","Green")

Then you can base your conditional formatting off of that measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.