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
PetyrBaelish
Resolver III
Resolver III

Conditional Fomratting Rule not working

I am trying to create a conditional formatting rule, to affect the font colour, on a field in a table visualisation (the field is a measure).

 

As can be seen below, to the left, the current figure is around -1 million. My rule should turn red anything between -1 billion and 0. My figure is in this range, but isn't turning red.

 

Measure COnditional FOrmatting.PNG

I think the problem is that the figure used in the visualisation is a measure, as I performed a similar test on column-based data and it worked (including with negative numbers).

 

Is it the case that measures can't be conditionally formatted? That seems like a massive oversight if so.

 

Note: with regards to my rule I only want to capture negative numbers, but the rule makes me specify and minimum and maximum of the range so I've specified an arbritary, but safe, figure.

 

1 ACCEPTED SOLUTION

So I've fixed my problem with a bit of a hack - basically by creating an additional column with a fixed value, and then adding this value to my visualisation (this column worked whereas my other one failed bacuase this one was in a table that is related to my measure - or at least that's my assumption).

 

All in all it's disapointing that such a workaround is necessary.

View solution in original post

4 REPLIES 4
PetyrBaelish
Resolver III
Resolver III

Further update, I read here Link that conditional formatting on a measure only works if there is a column present (that seems like a bug in itself to me). My existing visual is  a series of measures that come from a table containing only measures.

 

So I created a blank table with one blank cell and added this one cell to my visualisation - of course this filtered out all of my data. To overcome this I created a calculated column in my blank table as follows. The TableName used is kind of related to the measures as most of the measures are a calculation between the SUM of values across two different tables (I'm ot sure if that is relevant here)

 

Blank_Calc = ALL('TableName'[ColumnName])
 
I added this field to my visualisation, the measures are still displayed, but the conditional formatting still hasn't kicked in:
Measure COnditional FOrmatting2.PNG
 

So I've done what the article suggested and added a column to my visualisation but this hasn't worked.

but your value -1,10xxxxx is less than -1 Billion and for this you dont have a condition.. if it would be -0.6xxxxx it would be red.

you must make a condition what should happen in case it less than -1,000xxx

 

 

Hi @Sonne 

 

My value is -1.1 million (approx)

 

That should fit the criteria: greater than -1 billion (a minus figure) AND less than 0 given that -1 million is greater than -1 billion.

 

It works in Excel:

 

Measure COnditional FOrmatting3.PNG

 

So I think my logic is right.

So I've fixed my problem with a bit of a hack - basically by creating an additional column with a fixed value, and then adding this value to my visualisation (this column worked whereas my other one failed bacuase this one was in a table that is related to my measure - or at least that's my assumption).

 

All in all it's disapointing that such a workaround is necessary.

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.