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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
viggo71
Frequent Visitor

Conditionnal formating switch dynamic value

Hello,

 

how to color result based on objective value ? As below :

 

Item      Objective     Result

A            90%              95%

B            80%              70%

 

Thanks

1 ACCEPTED SOLUTION

@viggo71 assuming objective and results are columns, add following measure use it for conditional formatting.

 

My Color = 
IF ( MAX ( Table[Result] ) < MAX ( Table[Objective], "Red", "Green" )

 

if object and results are measures, remove MAX function in the above expression. Use My Color mesure in the conditional formatting.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@viggo71 , under conditional formatting in font choose advance control to choose rule-based, choose the measure and set the rule

 

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting

 

Or clear a measure like one given below and use it with field option in conditional formatting

Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")

refer

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

Thanks for your answer,

 

i don't understand how to do if i don't want to use static rules but only use dynamic one.

 

Objective is a field, not a static value, so, is there a solution to mark Result in green if > and red if < to this field ?

 

Thanks

@viggo71 assuming objective and results are columns, add following measure use it for conditional formatting.

 

My Color = 
IF ( MAX ( Table[Result] ) < MAX ( Table[Objective], "Red", "Green" )

 

if object and results are measures, remove MAX function in the above expression. Use My Color mesure in the conditional formatting.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors