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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SHicks216
Frequent Visitor

Is it possible to setup conditional formatting based on comparing two values from different columns?

Using the below table as a reference, I'm wanting to setup up conditional formatting so that the "Sum of Negative Reviews" column is dependent on several percentage thresholds related to the "Sum of Reviews" column (see ratings scale on attached image). For example if the "Sum of Reviews" is 55 and the "Sum of Negative Reviews" is 10, the background color should turn yellow because it falls between 9% and 21% of 55, which is a range of 4.95 and 11.55.  Any feedback is appreciated. Thank you. 

SHicks216_0-1673911393191.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@SHicks216 , Prefer measure, You can use a measure that returns color based on condition and use that in conditional formatting using the field value option

 

 

example

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 "
)
)

 

Measure =
Switch(true(),
max(Table[status]) = "In production" , "Red" ,
max(Table[status]) = " Product completed" , "Green" ,
"blue "
)

 

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@SHicks216 , Prefer measure, You can use a measure that returns color based on condition and use that in conditional formatting using the field value option

 

 

example

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 "
)
)

 

Measure =
Switch(true(),
max(Table[status]) = "In production" , "Red" ,
max(Table[status]) = " Product completed" , "Green" ,
"blue "
)

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.