Forum Discussion
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
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.⚡
3 Replies
- amitchandakSuper 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-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values- viggo71Frequent Visitor
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
- parry2kSuper User
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.⚡