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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
marksaba
Helper II
Helper II

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

3 REPLIES 3
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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors