Forum Discussion
New Button Slicer (November 2023 Update)- Conditional Formatting
I was having the same (or at least a similar) issue and eventually found a solution. I'm not sure if it is exactly what you were having, but I thought it might be worth sharing.
All I wanted to do was to have buttons dimmed if clicking them would return no records.
The two key things were that my measure needed to return a zero instead of null/blank, plus the colour representing >0 in my count needed to not be too close to white (#FFFFFF). If the colour was white or very close to it, all the buttons adopted the same colour regardless of value - I assume this is a bug.
I made a simple measure to do the count - Category is the field displayed on the slicer:
Category Count =
COUNT(Testing[Category]) + 0
SlicerFill =
SWITCH(
[Category Count],
0, "#EFECE9",
"#FEFEFE"
)
I assume you could use a simple IF() instead of the SWITCH() but I was playing around with more options for colour based on a scale of counts, so I already switch in play.
The measure with the +0 gives you this when something in my Testing table has been selected that only has on Category value:
This way we get all the buttons, all the time.
I created several measures so as to be able to format borders, text and fill colour when selected, but the above principle remains the same. Add the measure under Field Value to the appropriate state/object.