Forum Discussion
Conditional Formatting not working in Matrix Visual
- 11 months ago
A big thanks to everyone who has offered me help with this - thanks to your input I managed to find a way of solving my issue using the following DAX:
Percent of Row = DIVIDE( COUNT('Cases'[applicationvalidationdate]), CALCULATE( COUNT('Cases'[applicationvalidationdate]), REMOVEFILTERS('Cases'[Days to Validation Bins]) ) )
I then applied the following Conditiional Formatting criteria to the percentages (using numbers as advised).Which gives me the desrired result in my Matrix visual:
hi
The reason conditional formatting isn’t working in your matrix is because Power BI applies conditional formatting based on the field values, not on a calculated “% of Row Total” display directly. When you use “Show values as % of Row Total,” the formatting rules might not detect the underlying numbers correctly.
Here’s how to fix it:
Create a separate measure for the column you want to format (0–1mth %) that calculates the actual percentage:
Pct_0_1mth =
DIVIDE(
COUNTROWS(FILTER('Cases', [ColumnCondition] = "0-1mth")),
COUNTROWS('Cases')
)Use this measure in your matrix visual instead of relying on “Show values as % of Row Total.”
Apply conditional formatting on this new measure.
This ensures the conditional formatting rules are applied to the actual values you want, without affecting other columns.
If this was helpful, don’t forget to mark it as the solution and give a kudo!
Nabha Ahmed
- ArchStanton11 months agoPower Participant
Hi,
I tried your code and it gives me the following result:Pct_0_1mth = VAR CasesValidated = [AppValCount] RETURN DIVIDE( COUNTROWS( FILTER('Cases','Cases'[Days to Validation Bins] = "0-1 Mth")), CasesValidated)I want to see all of the Month 'Bins' and I only want to format values over say 50%. the values i the other bins will never go over 10%-20% so is it possible to format anything >=90% as Green,
>= 20% + <90% Red
< 20% (no formatting so just regular Black font?