Forum Discussion
Conditional Formatting on Count %RT
- 7 months ago
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.
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
for [% RT], how does one achieve this? I cannot seem to create a separate measure for [% RT] values
- amitchandak7 months agoSuper 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 "
)
)- pattaninlua7 months agoNew Member
Still unable to do so, I have created this measure but when I try to add the conditional formatting, it does not allow me to select the measure
color = if(FIRSTNONBLANK('pricing_index_test'[upc_id],[countSKUs]) < 0.5 ,Switch(true(),[countSKUs] >= .6 , "Green" ,[countSKUs] >= .4 , "Amber" ,"Red "))
If any other method is more helpful, I am happy to hear- amitchandak7 months agoSuper User