Forum Discussion
Anonymous
3 years agoNot applicable
DAX Support - Switch statement - Colouring for conditional formatting
Hi all! I have hit a stumbling block in my learning. I am really struggling with the DAX coding. I am looking to colour multiple values based on specific row categories. I can manage to do it for ...
- 3 years ago
Anonymous,
Try this measure:
Colour by category = SWITCH ( MAX ( 'TL Forecast Bookings'[Booking Type] ), "Chargeable", "LightGreen", "Provisional/Reserved", "Amber", "Vacation/Holiday", "Yellow", "Training/Exams", "Violet", "Non Chargeable", "Azure" )
DataInsights
3 years agoSuper User
Anonymous,
Try this measure:
Colour by category =
SWITCH (
MAX ( 'TL Forecast Bookings'[Booking Type] ),
"Chargeable", "LightGreen",
"Provisional/Reserved", "Amber",
"Vacation/Holiday", "Yellow",
"Training/Exams", "Violet",
"Non Chargeable", "Azure"
)FreemanZ
3 years agoSuper User
hi Anonymous DataInsights
it seems there is one argument too much or less,
Colour by category =
SWITCH (
MAX ( 'TL Forecast Bookings'[Booking Type] ),
"Chargeable", "LightGreen",
"Provisional/Reserved", "Amber",
"Vacation/Holiday", "Yellow",
"Training/Exams", "Violet",
"Non Chargeable", "Azure",
BLANK()
)
or
Colour by category =
SWITCH (
MAX ( 'TL Forecast Bookings'[Booking Type] ),
"Chargeable", "LightGreen",
"Provisional/Reserved", "Amber",
"Vacation/Holiday", "Yellow",
"Training/Exams", "Violet",
"Azure"
)