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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors