Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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"
)

 

 

 

 

 

 

 

Thank you!

  • Hi marksaba, 
    so here is your issue replicatred. 

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

    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. 

     

    And there you have it.

     

4 Replies

  • olgad's avatar
    olgad
    Resident Rockstar

    Hi marksaba, 
    so here is your issue replicatred. 

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

    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. 

     

    And there you have it.

     

    • Anonymous's avatar
      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!

      • olgad's avatar
        olgad
        Resident Rockstar

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