Forum Discussion
LamSar
2 years agoHelper III
Apply different Background Color for each item in calculation group
Good afternoon, I created a Calculation group with 9 items. I now need to add specific background colors to specific items in the caluculation group. The first two columns should have background ...
Sahir_Maharaj
2 years agoSuper User
Hello LamSar,
Can you please try this improved DAX:
Background Color Measure =
VAR CurrentSelection = SELECTEDMEASURENAME()
RETURN
SWITCH(
TRUE(),
CurrentSelection = "YourCalcGroupItem1" || CurrentSelection = "YourCalcGroupItem2", "#FFFF00", // Yellow
CurrentSelection = "YourCalcGroupItem3" || CurrentSelection = "YourCalcGroupItem4", "#008000", // Green
CurrentSelection = "YourCalcGroupItem5" || CurrentSelection = "YourCalcGroupItem6", "#0000FF", // Blue
CurrentSelection = "YourCalcGroupItem7" || CurrentSelection = "YourCalcGroupItem8", "#FFC0CB", // Pink
BLANK() // No color for Column 9 and others
)
LamSar
2 years agoHelper III
Good morning Sahir,
This doesn't work.
When I use this measure nothing happens.
I added the measure to the matrix to see if it returns the color codes, but it returns the same value of the calculation items itself: