Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
JoeVincent
New Member

Matrix table conditional formatting based on category and value - Dax coding?

Hi there, 

 

I am at the final stage of my dashboard and I'm struggling to create conditional formatting based on multiple parameters and could really do with some help please.

I have attached a mocked up table of how my table appears. I am looking to create conditional formatting based on Grade and the specific value based on utilisation expectations for that grade. I've chosen to use mock data just to represent the data and not risk any issues with data protection/GDPR.

 

Grade expecations:
Director: 50+ Green, 40-50 Amber, <40 Red
Senior Manager: 65+ Green, 55-65 Amber, <55 Red

Manager, Senior Associate and Associate: 75+ Green, 65-75 Amber, <65 Red

 

(Merged cells were taken out when this was posted. For reference, there is a PW, P4W and YTD column under each grade. Sorry!)

Grade1 Director2 Senior Manager3 Manager4 Senior Associate5 Associate
LoSPWP4WYTDPWP4WYTDPWP4WYTDPWP4WYTDPWP4WYTD
X405060807580659070605090704080
Y505060607065807580806080906050
Z2040704045707080759070601008560

 

JoeVincent_2-1677845937101.png


Thank you so much in advance!

Screen snip of example table:

JoeVincent_0-1677847365834.png



I've used this DAX expression for a matrix table in a different dashboard, was wondering if this could be repurposed?

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""DodgerBlue"
)
5 REPLIES 5
Padycosmos
Solution Sage
Solution Sage

NishPatel
Resolver II
Resolver II

You can use cell elements property under visual property to conditionally format each series. 

NishPatel_0-1677846641821.png

 

Thanks for the quick response Nish. That seems to apply it for PW/P4W/YTD irrespective of Grade unless I am missing something?

@JoeVincent , I doubt you can do conditional formatting for row/column fields. You can do series-based colors or column-based

 

for values, you can use conditional formatting. BUT not for row/column

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I've used the below dax expression to colour different values based on different conditions in a separate dashboard. Wondering if this can be repurposed for this?
 
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", "DodgerBlue"
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.