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 ArchStanton
Create a measure to be used as the field value in conditional formatting:
Conditional Formatting Color =
VAR _pct = [percentage measure]
RETURN
IF (
'table'[column category] = "0-1 Mth",
SWITCH (
TRUE (),
_pct >= 0.9, "green or a hexadecimal value",
_pct >= 0.9, "red or a hexadecimal value",
_pct >= 0, "black"
)
)
From Format Style, select Field Value and then select the measure above from the dropdown.
Hi, thanks for your reply.
I can't get this to work. I have a calculated column which counts the number of cases that are in the following bins:
0-1 Mth
1-2 Mths
2-3 Mths
Older
This Calculated Column is located in my main Fact table 'Cases'[Days to Validation Bins]
I have created a % Measure for 0-1 Mth only=
1 Mth % =
VAR UnderOneMth = [0-1 Mth Count]
VAR AllBinAges = [ALL Count]
RETURN
DIVIDE(UnderOneMth,AllBinAges)
0-1 Mth Count Measure =
0-1 Mth Count =
CALCULATE(
[AppValCount],
KEEPFILTERS(
'Cases'[Days to Validation Bins] = "0-1 Mth"))
All Count Measure
All Count =
CALCULATE(
[AppValCount])
I'm not really sure what to do with this, I've replied to another expert so maybe what I have said there may help?
- Ashish_Mathur11 months agoSuper User
Hi,
Share the download link of the PBI file.
- ArchStanton11 months agoPower Participant
Not possible due to data privacy I'm afraid
- danextian11 months agoSuper User
Create a copy of that report with confidential data anonymized or removed. We don't need the actual pbix.
- ArchStanton11 months agoPower Participant
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: