Forum Discussion
Conditional formatting comparing 2 percentage columns
I have a table with actual hrs worked, target hrs to work, target % to wrk, and actual % to target %. I want to color code based on actual % to target % vs actual %. If the number is lower than actual % the background should be green. Otherwise, red.
Any help would be appreciated.
ahhollan , You can create a measure that returns color based on condition and used that in conditional formatting using field value option
Switch(true() ,
[actual%] < [Target%] , "Red", "Green")
Change conditions as per need
PowerBI Abstract Thesis: How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/1682539
1 Reply
- amitchandakSuper User
ahhollan , You can create a measure that returns color based on condition and used that in conditional formatting using field value option
Switch(true() ,
[actual%] < [Target%] , "Red", "Green")
Change conditions as per need
PowerBI Abstract Thesis: How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/1682539