Forum Discussion

vikramkumawat's avatar
vikramkumawat
Advocate II
2 years ago
Solved

Highlight Blank Value in Matrix Visual

Hi Experts,
I was trying to implement a matrix visual and apply some conditional formatting to highlight the columns with different background colors.

 

However, the background color is not applied to the blank values, as shown in the image. I tried adding 0 to the measure I am using, but this resulted in many extra rows and columns with a value of 0 for all countries.

I need guidance on how to avoid the issue of getting extra rows and columns or how to apply the background color to blank values.

Thanks!

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi vikramkumawat ,

     

    Thanks Shivu-2000  for the quick reply and solution. Allow me to provide additional insights:

    (1)We can create measures.

    profits = CALCULATE(SUM(Orders[Profit]),ALLSELECTED(Orders),Orders[Country] in VALUES(Orders[Country]),YEAR(calentar[Date]) in VALUES(calentar[Date].[Year]),MONTH(calentar[Date]) in VALUES(calentar[Date].[MonthNo]))
    profit color = 
    VAR a = SELECTEDVALUE(calentar[Date].[Month])
    RETURN SWITCH(TRUE(),
    a = "January","red",
    a = "March","green")

    (2) Set up conditional formatting.

    (3) Manually modify the column width of the Profitt Colo to hide it.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

6 Replies

  • Shivu-2000's avatar
    Shivu-2000
    Responsive Resident

    Hi vikramkumawat 
    To format the Color column based on its field values, select Conditional formatting for the Color field, and then select Background color or Font color. In the Background color or Font color dialog box, select Field value from the Format style drop-down field.
    https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting



    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Happy to help!

    • vikramkumawat's avatar
      vikramkumawat
      Advocate II

      Hi Shivu-2000,
      Thanks for the advice. I tried to apply the formatting as you suggested. I am using measures to display the values and also to set the background color. However, I do not have the option to use blank as zero, and blank values are not displaying any background color.
      Is there any way where I can give background color to the blank cells or to place 0 only in the cell where any cell of the row have data (should not add extra rows )

      Thanks !

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi vikramkumawat ,

     

    Thanks Shivu-2000  for the quick reply and solution. Allow me to provide additional insights:

    (1)We can create measures.

    profits = CALCULATE(SUM(Orders[Profit]),ALLSELECTED(Orders),Orders[Country] in VALUES(Orders[Country]),YEAR(calentar[Date]) in VALUES(calentar[Date].[Year]),MONTH(calentar[Date]) in VALUES(calentar[Date].[MonthNo]))
    profit color = 
    VAR a = SELECTEDVALUE(calentar[Date].[Month])
    RETURN SWITCH(TRUE(),
    a = "January","red",
    a = "March","green")

    (2) Set up conditional formatting.

    (3) Manually modify the column width of the Profitt Colo to hide it.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.