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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
vikramkumawat
Advocate II
Advocate II

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.

vikramkumawat_1-1719399616458.png

 

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!

 

1 ACCEPTED SOLUTION
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.

vtangjiemsft_0-1719568224224.png

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

vtangjiemsft_1-1719568357757.png

 

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. 

View solution in original post

6 REPLIES 6
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.

vtangjiemsft_0-1719568224224.png

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

vtangjiemsft_1-1719568357757.png

 

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. 

Shivu-2000
Super User
Super User

Hi @vikramkumawat 
Can you provide me your data or similiar dummy data.

Hi @Shivu-2000 ,
Please find the PBIX file in bellow onedrive link:

Dummy data.pbix

(https://44g4h0-my.sharepoint.com/:u:/g/personal/vikramkumawat_44g4h0_onmicrosoft_com/EV8ziQQ_DwxKj8W... in above file I am able to apply background color to the cells which have any value but for blank cells i am not able to do so, also when I try to fill the blank cells with 0 by adding it to measure it adds extra columns and extra rows in the visual with all value 0.
Please suggest me any possible solution to apply background color to the column if the cell is blank or not.
Thanks!

 

Hi @vikramkumawat 
You need to select Cell element -> Background Color -> Rules
This will help you to fill the colors if it is blank.

Shivu2000_1-1719564310542.png

 

Shivu2000_0-1719564299361.png

Shivu2000_2-1719564355495.png




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

Happy to help!

 

Shivu-2000
Super User
Super User

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!

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 !

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.