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