Forum Discussion
Conditional Formatting on Count %RT
Hi,
There was a request to add conditional formatting to the following Matrix (Cropped to remove confidential name features) to highlight when values are above 50%
The percentages were formed from using %RT as shown here
From previous attempts, I have tried to apply conditional formatting but it seems to apply to the total count rather than to count % (I also have a table next to this one which shows that).
Is there a way to do this?
Notes:
The counts are items in column (upc_id) which I have created a measure as follows: countSKUs = count(table[upc_id])
The row columns are items in column (Status 1)
HI pattaninlua ,
To resolve the issue, first create a measure to calculate the count of the relevant field. Then, build a separate percentage measure based on that count, ensuring it reflects the proportion of each category within the selected context and is formatted as a percentage. Next, create a color measure that assigns different colors depending on the percentage thresholds, making sure totals or grand totals are excluded if needed. In your matrix visual, replace the existing percentage field with the new percentage measure, and apply conditional formatting using your color measure. To do this, choose background color formatting, set the format style to 'Field value', apply it to values only, and select the color measure as the field to base the formatting on. This approach ensures that conditional formatting correctly reflects the percentage measure rather than raw counts.
Find the below attached .pbix file for your reference.
Thank you.
10 Replies
- amitchandakSuper User
pattaninlua , While apply you have option where to apply or GT or all rows.
You can create a measure like below and use that in conditional formatting in font or background
If([% RT] >=.5 , "Red", "Green")
If you want to hide the number, use "#FFFFFF00" or have the same color for font and background. Use this in conditional formatting using the field value option- pattaninluaNew Member
for [% RT], how does one achieve this? I cannot seem to create a separate measure for [% RT] values
- amitchandakSuper User
pattaninlua , You can use Any measure which you have Like [RT % COuntSKUs] and can have various logics
These are just examples
Color Date = if(FIRSTNONBLANK('Date'[Date],TODAY()) < date(2022,04,10) ,
Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .75 , "Amber" ,
"Red "
) ,
Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .5 , "Amber" ,
"Red "
)
)Color = Switch( True() ,
Max(Table[Status]) < 200 ,
Switch(true(),
[ERB] = .25 , "Orange" ,
"Red "
) ,
Max(Table[Status]) < 500 ,
Switch(true(),
[ERB] = .25 , "Orange" ,
"Red "
) ,
Switch(true(),
[ERB] = .25 , "Orange" ,
"Red "
)
)
- cengizhanarslanSuper User
Select the matrix → Format pane → Conditional formatting (Background color or Font color) for the value you want:
Format by: Field value
Based on field: RT Color
- pattaninluaNew Member
I have tried that already but there is no option to select %RT in Field.
Another option would be much apreciated
- v-tejramaCommunity Support
HI pattaninlua ,
To resolve the issue, first create a measure to calculate the count of the relevant field. Then, build a separate percentage measure based on that count, ensuring it reflects the proportion of each category within the selected context and is formatted as a percentage. Next, create a color measure that assigns different colors depending on the percentage thresholds, making sure totals or grand totals are excluded if needed. In your matrix visual, replace the existing percentage field with the new percentage measure, and apply conditional formatting using your color measure. To do this, choose background color formatting, set the format style to 'Field value', apply it to values only, and select the color measure as the field to base the formatting on. This approach ensures that conditional formatting correctly reflects the percentage measure rather than raw counts.
Find the below attached .pbix file for your reference.
Thank you.