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
RachnaV
Helper I
Helper I

Conditional Formatting not working

I have a Matrix visual wherein conditional formatting has been applied on the background. There some filters defined on the report.


Conditional formatting is working correct when no filter is applied (refer to image 1).

 

Image 1Image 1


But on applying any filter the conditional formattng goes away (refer to image 2).

 

Image 2Image 2

 

I have verified the conditional formatting rules and they look fine. (Image 3).

 

Image 3Image 3

Would anyone know what is the issue here and how to resolve it as the conditional formatting rules are correct and work as long as no filters are applied. When some filter is applied complete conditional formatting goes away.

7 REPLIES 7
v-kkf-msft
Community Support
Community Support

Hi @RachnaV ,

 

Has your problem been solved? If it is solved, please mark a reply which is helpful to you.

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.


Best Regards,
Winniz

The issue got resolved when I moved all the measures with conditional formatting into an existing marix visual that had few other measues (without any conditional formatting) defined. This looks like a bug because when the measures were placed inside a new matrix visual and any filter was selected the color coding just went away but this is not happening when the same measures have been placed into an existing matrix visual.

v-kkf-msft
Community Support
Community Support

Hi @RachnaV ,

 

You can't apply gradient formatting with automatic maximum/minimum values, or rule-based formatting with percentage rules, if your data contains NaN values. NaN means "Not a number," most commonly caused by a divide by zero error. You can use the DIVIDE() DAX function to avoid these errors.

 

If the problem is still not resolved, please provide your PBIX file without sensitive data. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

jdbuchanan71
Super User
Super User

When you select Percent in this dropdown, you’re setting the rule boundaries as a percent of the overall range of values from minimum to maximum. 

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting


If the field the formatting is based on contains percentages, write the numbers in the rules as decimals, which are the actual values; for example, ".25" instead of "25". Also, select Number instead of Percent for the number format. For example, "If value is greater than or equal to 0 Number and is less than .25 Number" returns values less than 25%.

 
jdbuchanan71
Super User
Super User

@RachnaV 

I don't think your conditional formatting is working even in the first image.

2022-01-11_19-11-53.jpg

 

Instead of using Percent try changing the rules to number.

>= 0 number and <= .899 number
>= .9 number and <= .95 number
>= .951 number and <= 1 number

I changed the formatting rules as you suggested but still same issue persists.Attaching the snapshot of changed rules.

Also, would like to understand why you suggested changing the rules to number instead of percentage as all my measures in this visual are having values in percentage.

 

Fourth Image_Conditional Formatting on Background_rules defined.png

I'm seeing the same thing today. Did you manage to fix the bug?

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.