Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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 1 category but then when I try to add more into the mix, it all falls apart.
Below is the DAX code I can get working for colouring values in my matrix table which are categorised as 'Chargeable' as the colour of light green:
Background color = IF(MAX('TL Forecast Bookings'[Booking Type]) = "Chargeable", "LightGreen", BLANK()))
This is the SWITCH code that I can't get to work where I am looking to colour multiple different booking types to different colours:
Solved! Go to Solution.
@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"
)
Proud to be a Super 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"
)
Proud to be a Super 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"
)
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 51 | |
| 46 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 135 | |
| 110 | |
| 50 | |
| 31 | |
| 29 |