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"
)Anonymous
3 years agoNot applicable
Thank you! Ended up continuing to tweak mine while I was waiting for a response and found that this also works (changed some colours due to preference):
Colour by category =
SWITCH (TRUE (),
MAX('TL Forecast Bookings'[Booking Type]) = "Chargeable", "LightGreen",
MAX('TL Forecast Bookings'[Booking Type]) = "Provisional/Reserved", "Orange",
MAX('TL Forecast Bookings'[Booking Type]) = "Vacation/Holiday", "Yellow",
MAX('TL Forecast Bookings'[Booking Type]) = "Training/Exams", "Violet",
MAX('TL Forecast Bookings'[Booking Type]) = "Non Chargeable", "DodgerBlue",
MAX('TL Forecast Bookings'[Booking Type]) = "Internal Project", "DodgetBlue"
)