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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.