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

Conditional Formatting on %

Hi, 

 

I'm trying to put some conditional formatting on %s in a matrix table, but it doesn't seem to be working...

 

any ideas?

 

Thank you!

 

Sonia

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@Anonymous,

Please check my example in the PBIX file below. If you still have questions, please share sample data of your table.

https://1drv.ms/u/s!AhsotbnGu1NokzC8lquSkaLxwGmz

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

12 REPLIES 12
v-yuezhe-msft
Employee
Employee

@Anonymous,

Please check my example in the PBIX file below. If you still have questions, please share sample data of your table.

https://1drv.ms/u/s!AhsotbnGu1NokzC8lquSkaLxwGmz

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

What data formats are the percentages? Have you tried creating a measure to display the information?  I've had troubles in the past with Conditional Formatting which all resolved when i created a measure to do display the information.

Anonymous
Not applicable

hi @Anonymous, 

 

Thanks for your response!

 

I tried creating new calculated columns to get the %, but it still doesn't seem to be working. 

 

It's strange, because I've managed to do exactly the same thing before... 

Anonymous
Not applicable

Correct, calculated columns would produce the same issue.  Measures are different but can be used to create a similar outcome for the purpose of a visual.

 

Measures are context sensitive, so you could write a measure to simply take the first value in a column (Text) or for a Max value of a number.  If the context of your visual is such that you are getting 1 value per line anyway, the measures context will only ever be that single value.  Thus the measure will provide you with the same result, but the conditional formatting seems to be kept happier.

Anonymous
Not applicable

Thanks @Anonymous!

 

Are you able to provide some more detail into the DAX i should use for the measure? 

 

My calculated columns are just MOM change and YOY change 

Thanks again!

 

Sonia

Anonymous
Not applicable

The measure would look something like

 

MOM Display = MAX('YourTable'[MOMField])

Nothing all that fancy, now if you bring that into the table as if it was a field, it should display the same information.

Anonymous
Not applicable

Thanks @Anonymous, 

 

I created this measure (which gave me the right number), but it still doesn't seem to work! 

Anonymous
Not applicable

What are you putting into the conditional formatting? Can you screen shot it?

 

Remember that a percentage will be recorded as a decimal number.  So 50% will actually be 0.50.

Anonymous
Not applicable

Capture3.PNG

Sure, see above 🙂 

 

yeah, i did notice that the measure comes out as a decimal. Is there anyway to change to display as % (if we can fix the cond form, haha)? 

 

Anonymous
Not applicable

Yes you can format as a percentage, all you need to do is click on the measure (after creating it you need to click elsewhere and click back).  In the modelling section of the ribbon, there is an area to select the data type and the data format.  You can select Percentage from there.

 

In the colour by rules, you should be able to select a single condition for each row.  That being less than Zero and Greater than or equal to 0.  I still would have expected this to work.  I notice it is "Font Colour Scales", so part of me also wants to check if the change has happened but is a little subtle?

Anonymous
Not applicable

Here is one that i did on some percentages.  This one does red for below zero and green for above 0.

 

I used a colour gradient instead, but the theory should be similar:

 

Capture.PNG

Anonymous
Not applicable

Thanks @Anonymous, 

 

still not changing my number! So strange... 😞 

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.