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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
ahhollan
Helper I
Helper I

Conditional formatting complex situation comparing two percentages

I need to conditionally format a column based on the following rules. (also see screenshot below)

If Actual to Target is greater than EE Target % , it is red (employee has charged more to default than target). If Actual to Target is less than EE Target %, it is green (employee has charged less to default than target). If Actual to Target is 100% and the EE Target is 100%, it is green (employee has charged 100% to default which is expected-there are not many of these). If Actual to Target is 100% and the EE Target is less than 100%, it is red (employee has charged 100% to default and their target % is less than 100%).

 

Below is the screenshot with conditional formatting partially working. 

ahhollan_0-1681216357681.png

Below are my rules. I can't quite get them right. Thanks in advance for the help.

ahhollan_1-1681216421506.png

 

1 REPLY 1
amitchandak
Super User
Super User

@ahhollan , Create a color measure

 

example

 

if([M1] > [M2], "Green", "Red")

 

or

 

Switch( True() ,
[Percent] =1 , "Green"
[percent] <.75 , "red",
[percent] <.99 , "Yellow"
)

 

Measure =
Switch(true(),
max(Table[status]) = "In production" , Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .5 , "Amber" ,
"Red "
) ,
max(Table[status]) = " Product completed" , Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .5 , "Amber" ,
"Red "
)
)

 

 

Use that is conditional formatting using the field value option

 

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/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

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

Helpful resources

Announcements
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.