Forum Discussion

sarah2_williams's avatar
sarah2_williams
Helper III
4 years ago
Solved

Conditional Formatting colours using Dax

Hi all,

 

Just after a bit of DAX help - or suggestions on any other way I can achieve this.. I have a matrix similar to the below: 

I want the background of the Cells to be a certain colour based on the Item. e.g. Trainers and Boots = Red, T-shirts and Jumpers = Blue, Trousers and Shorts = Yellow.

 

Item201920202021
Trainers101010205622

Boots

200254563
T-shirts30036952
Jumpers25515638546
Trousers1252325587
Shorts235223362536

 

I have created a SWITCH measure ( =SWITCH(SELECTEDVALUE(Sales[Item]), "Trainers", "Red", "Boots", "Red", "T-shirts", "Blue" etc) so that I can assign the values a certain background colour using conditional fomatting- but I want the actual Item cells to have the background colour..

 

Any suggestions welcome 

 

thanks

Sarah

3 Replies