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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to apply Conditional Formatting comparing a column and a calculated measure?

Hello,

I am having a hard time while applying conditional formatting based on multiple columns.

This is the chart I am trying to apply the conditional formatting on:

UroosaAshfaque_0-1628078309828.png

 

 

X is a calculated measure. Both the columns are from the same table in the model.

 

First, I tried to create a column like this to define the format:

UroosaAshfaque_1-1628078309831.png

 

 

According to this, the second row should turn red and the other two should remain green. But when I apply this on the conditional formatting on field X, this happens:

UroosaAshfaque_2-1628078309833.png

 

 

UroosaAshfaque_3-1628078309834.png

 

You can see that it is returning all the values as ‘green’ which shouldn’t be the case. Specially with the second value.

Also in the Font Color – X settings, why is it summarizing on ‘First’?

 

I tried to eliminate the CATEGORY column condition from the measure and kept it only on the condition if X > 0.75 but the result is the same. Even though if I apply conditional formatting on the X field directly via chart settings, it works perfectly fine. What could be the issue here? I want to use both Category and X for conditional formatting.

 

If it helps, there are other columns and measures other than these two in the table as well.

Please let me know how I can fix this. Thanks!

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Create a measure like this and try.

 

If([X] >.73 && max(net[Category]) ="FOOD" , "red", "green")

 

refer if needed

https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/1682539

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors