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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
sarah2_williams
Helper III
Helper III

Conditional Formatting colours using Dax

Hi all,

 

Just after a bit of DAX help - or suggestions on any other way I can achieve this.. I have a matrix similar to the below: 

I want the background of the Cells to be a certain colour based on the Item. e.g. Trainers and Boots = Red, T-shirts and Jumpers = Blue, Trousers and Shorts = Yellow.

 

Item201920202021
Trainers101010205622

Boots

200254563
T-shirts30036952
Jumpers25515638546
Trousers1252325587
Shorts235223362536

 

I have created a SWITCH measure ( =SWITCH(SELECTEDVALUE(Sales[Item]), "Trainers", "Red", "Boots", "Red", "T-shirts", "Blue" etc) so that I can assign the values a certain background colour using conditional fomatting- but I want the actual Item cells to have the background colour..

 

Any suggestions welcome 

 

thanks

Sarah

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

You mean that instead of this

 

lbendlin_0-1648944192865.png

 

 

you want the row header background color changed?   Bad news I'm afraid.

 

Microsoft Idea (powerbi.com)

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

You mean that instead of this

 

lbendlin_0-1648944192865.png

 

 

you want the row header background color changed?   Bad news I'm afraid.

 

Microsoft Idea (powerbi.com)

Yes.. I wanted just the row headers to be coloured.

 

I've had no luck finding a solution. 

Thanks

Hi @sarah2_williams 

 

Currently the conditional formatting feature isn't applied on the row/column headers. It is only applied on Values fields. I'm afraid there is no such solution or workaround to format their background at present. 

 

There are some similar ideas about this requirement you can vote up:

Microsoft Idea - Conditional Formatting of Row Headers in Matrix

Microsoft Idea - conditional formatting

Microsoft Idea - Condititonal Formatting for Row Header

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.