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

Advanced card conditional formatting with a Measure

Hi all,

 

Sorry for this very simple question but, I have completely ran out of ideas.

 

I have set up an advanced card with a measure that returns a calculation alongside an up or down arrow (see below).

Total = [Last Month total]-[Count of Cat]&IF([Count of Cat]>0,"↑","↓")
 

Unfortunately I need to use conditional formatting, but I can’t get it to work with this measure. I am looking for a result of >0 = green & <0 = red. I have set the parameters of the 'conditions' options, but the advanced card does not change.

 

Looking at the measure, the format appears to be set as "text", and the option to change to "whole number" is greyed out. I suspect this is why the conditional formatting isn’t working? 

 

Can this format be changed? If not, is there a way to display a number with an arrow in an advanced card with the conditional formation below?

>0 = green

<0 = red

 

Help as always is massively appreciated,

 

CF

1 ACCEPTED SOLUTION
5 REPLIES 5
Anonymous
Not applicable

Thanks everybody, i greatly appreciate all of your contributions.
 
tex628, i tried your method, but unfortunatley i couldnt get it to work.
 
In the end, the following link provided by amitchandak worked.
 
 
Thank you all
tex628
Community Champion
Community Champion

Yeah, it was my bad. The "&" in the measure automatically converts the format to string. The correct measure should have been just:

Format = IF([Count of Cat]>0,0,1)

But I'm happy you got it sorted! 

/ J


Connect on LinkedIn
tex628
Community Champion
Community Champion

Your measure is returning arrows which are bound to text format. If you create another measure,

Format = [Last Month total]-[Count of Cat]&IF([Count of Cat]>0,0,1)


You can then use this measure to conditionally format your "Total" measure. 

image.png

Add you "Total" measure to the visual, apply conditional formatting, change the based on field value from "Total" to "Format".

This should allow you to get the correct colors on your arrows. 


/ J


Connect on LinkedIn
Anonymous
Not applicable

Hi there,

 

Massive thanks for taking your time to help.

 

I have created another measure as below:-

Format = [Last Month total]-[Count of Cat]&IF([Count of Cat]>0,0,1)

 

I have also added my 'total' measure to the visual.

 

However when adding conditional formatting to the 'based on field' value am unable to select the measure 'format'.

 

Again it looks like the 'format' measure is bound to text format, as i am unable to change it whole number.

 

I am obviously doing something very stupid (it's been a long day). Any idea what i am doing wrong here?

 

Thank yoouuuuu

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.