Forum Discussion
Conditional formatting stops working when using slicer
- 2 years ago
Hi y_s_c
I think the issue is caused by the ALL(Table1[Something]) in the measures.
Can you tell me the bahaviour you would like to acheive in the visual?
Example when you filter Europe what do you want to see? Do you want the colour formatting to Jump to Europe, but still see all the other continents?
The colour coding logic doesn't make sense, you will always have less than All and Never More than all. Is there a % value that we can measure against?
Asia colour formatting = IF ( [Asia %] = BLANK (), "", IF ( [Asia %] < [All], "#feb5b1", IF ( [Asia %] > [All], "#cee2cd" ) ) )
Hi y_s_c
I think the issue is caused by the ALL(Table1[Something]) in the measures.
Can you tell me the bahaviour you would like to acheive in the visual?
Example when you filter Europe what do you want to see? Do you want the colour formatting to Jump to Europe, but still see all the other continents?
The colour coding logic doesn't make sense, you will always have less than All and Never More than all. Is there a % value that we can measure against?
Asia colour formatting =
IF (
[Asia %] = BLANK (),
"",
IF (
[Asia %] < [All],
"#feb5b1",
IF ( [Asia %] > [All], "#cee2cd" )
)
)
The colour measures draw comparison to [Total %], which is a simple measure that computes the proportion of all "Somethings" irrespective of continent. The measures make sense and colour format the cells properly if the slicer isn't used (see screenshot below). The colour simply displays red for those continents below the "total %" or green for those above. [All] isn't a measure in the example pbxi I linked in my previous post 🙄
I'm just curious as to why when the slicer is activated, the selected continent stops displaying coloured cells, e.g., if filtering by "Europe", the matrix will show no colour under "Europe %" but the rest of columns will keep showing the formatting. An example of this below:
Hope that makes sense! It isn't a huge problem because this isn't a real-life issue of mine, but came across this behaviour and wanted to understand it 😄
- Anonymous2 years agoNot applicable
Hi, y_s_c
Thanks for y_s_c reply. My opinion is the same as his, the Measure you wrote doesn't reflect the judgment situation when the two are the same. After the data is filtered, [Asia%] and [Total%] are equal, so naturally there is no color shown.Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum