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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
lordtopcat
Helper I
Helper I

Matrix - Show Blank instead Zero

Hi,

 

Just wondering if there is a way, like in Excel to show a blank in a cell (Matrix visual) when the result is 0?

 

pbi0.png

 

Cheers,

Jamie

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hey, @lordtopcat

You don't need to create 12 measures for each column whose value is zero, you can try replacing zero with null in Power Query Editor, you can follow this:

  1. Open Power Query Editor, select the columns you want to display in visual, and the columns used in the measures you created to display in visual.

(You can hold down ctrl and left click on all columns that you want to achieve multiple selections), like this:

v-robertq-msft_0-1602553263126.png

  1. Click 'Replace Values', from '0' to null, like this:

v-robertq-msft_1-1602553263130.png

And you can see that all zero values will be blank in the visual.

Best regards

Qin Community Support _Robert Team

If this post helps,then consider Accepting it as the solution to help other members find it faster.

View solution in original post

7 REPLIES 7
v-robertq-msft
Community Support
Community Support

Hey, @lordtopcat

You don't need to create 12 measures for each column whose value is zero, you can try replacing zero with null in Power Query Editor, you can follow this:

  1. Open Power Query Editor, select the columns you want to display in visual, and the columns used in the measures you created to display in visual.

(You can hold down ctrl and left click on all columns that you want to achieve multiple selections), like this:

v-robertq-msft_0-1602553263126.png

  1. Click 'Replace Values', from '0' to null, like this:

v-robertq-msft_1-1602553263130.png

And you can see that all zero values will be blank in the visual.

Best regards

Qin Community Support _Robert Team

If this post helps,then consider Accepting it as the solution to help other members find it faster.

If I do it this way I get errors in the query editor because the columns are configured as decimals. =(

@v-robertq-msft  You're a legend! Thank you very much 👍

mahoneypat
Microsoft Employee
Microsoft Employee

Sure.  Here is one way to do it.  First store your expression in a variable, then check if it is zero and return blank if so.

 

MyMeasure = var __result = SUM(Table[Column])

return IF(__result = 0, BLANK(), __result)

 

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Oh, sorry should have clarified - I have 12 values that I need this to apply to, I don't want to have to create 12 more measures just to suppress the zeros.

 

This is such a basic function, surely there's a toggle somewhere I'm missing?

Another option is to use conditional formatting on the font color to match the background when the result is 0.  However, you will need to set that for each column too.

 

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


NatachaPN
Frequent Visitor

I suggest you to create a measure like this:


MyMeasure =
VAR x = SUM(MyTable[MyField])
RETURN if(x=0, BLANK(), x)

 

Use that measure instead the field. For instance, you have this table "Tabla":

Captura3.PNG

 

You add a measure: 

MyMeasure =
VAR x = SUM(Tabla[Columna2])
RETURN if(x=0, BLANK(), x)

 

having this behavior on the matrix: 

Captura4.PNG

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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