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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Individual Row Colors in Matrix

Hello!

 

I am attempting to color individual rows of a matrix. I understand this is not currently a feature in Power BI, but using this YouTube video, I was able to find a work around. I used the below measure, which I used as Conditional Formatting, to color the rows based on the HEX color listed in each row of the measure. However, this seems to exclude cells with a zero/blank value. 

 

How can I modify the below measure to ensure all cells for each row have the same formatting? For instance, "In Transit Receipts" shows many white cells because they have no value. I would like these cells to be the same light blue color as the cells with a value.

 

Metric Colors = SWITCH( TRUE(),
MAX('APO Monthly'[MetricNew])="Forecast","#d9e1f2",
MAX('APO Monthly'[MetricNew])="Sales Order","#d9e1f2",
MAX('APO Monthly'[MetricNew])="Global Sales Orders","#d9e1f2",
MAX('APO Monthly'[MetricNew])="Global Forecast","#d9e1f2",
MAX('APO Monthly'[MetricNew])="DI Forecast","#e6e6e6",
MAX('APO Monthly'[MetricNew])="Stock Transfer (Out)","White",
MAX('APO Monthly'[MetricNew])="SAP Suggested Buy","#e6e6e6",
max('APO Monthly'[MetricNew])="In Transit Receipts","#d9e1f2",
MAX('APO Monthly'[MetricNew])="Confirmed Receipts","#d9e1f2",
MAX('APO Monthly'[MetricNew])="Additional Confirmed Receipts (Inc STO In)","#d9e1f2",
MAX('APO Monthly'[MetricNew])="Total Demand","#09124f",
MAX('APO Monthly'[MetricNew])="Total Receipts","#09124f",
max('APO Monthly'[MetricNew])="Stock On Hand (Projected)","#055201",
"White"
)

 

Screenshot 2023-01-13 163507.png

 

 

 

 

 

 

Thank you!

1 ACCEPTED SOLUTION
olgad
Super User
Super User

Hi marksaba, 
so here is your issue replicatred. 

olgad_1-1673728039704.png

Add +0 to your measure, in my case it is Sales

olgad_2-1673728115133.png

If you do not wish 0 to appear, you have to create one more measure for the font adding

 && [Sales]=0 to each line.Then add font conditional formatting to your measure. 

 

olgad_5-1673728407011.png

And there you have it.

olgad_6-1673728427925.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

View solution in original post

4 REPLIES 4
jstanley1017
Frequent Visitor

How would one extrapolate this to rows and columns?

olgad
Super User
Super User

Hi marksaba, 
so here is your issue replicatred. 

olgad_1-1673728039704.png

Add +0 to your measure, in my case it is Sales

olgad_2-1673728115133.png

If you do not wish 0 to appear, you have to create one more measure for the font adding

 && [Sales]=0 to each line.Then add font conditional formatting to your measure. 

 

olgad_5-1673728407011.png

And there you have it.

olgad_6-1673728427925.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime
Anonymous
Not applicable

Thank you so much for the detailed suggestion! Unfortunately, neither solution worked for my matrix. For some reason, adding the +0 or an IF formula to my value to generate a 0 did not register a 0 for many cells. Even when it did, adding the Value = 0 in the Color Measure did not format these 0 cells. I have also tried changing the MAX formula to be a SELECTEDVALUE formula, following other suggestions on Reddit, which did not work either. Might you have another suggestion? If not, might you know what could be different about our datasets that is causing your suggestion to work for your matrix but not mine?

Thank you!

Can you share your report in private message? I can then take a look and fix it if i can


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.