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
pasno
Helper II
Helper II

Hide matrix row with value 0

Hi guys,

 

I have an issue using matrix in PBI.

I'd like to remove my row when it has value 0 becaume my report becomes too long with many rows without values as you can see from the sreenshot.

Do you know how to do it please?

I had to put measures in rows instead of in columns but now I'm sutck here.

 

pasno_0-1709560249383.png

 

 

Thank you very much!!

 

1 ACCEPTED SOLUTION

Hi @pasno ,

I looked at the structure in detail and realized that Trasporti and Magazzino are one and the same in matrix, and even with filters they can not change.

vyilongmsft_1-1709889956908.png

vyilongmsft_0-1709889492126.png

So I think it is more difficult to try to implement it in matrix, but it would be easier to choose table visual.

vyilongmsft_2-1709890095558.png

 

 

 

Best Regards

Yilong Zhou

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

10 REPLIES 10
Greg_Deckler
Super User
Super User

@pasno Can you use the Filters pane?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 

thank you for your answer.

I did it but removing blank rows it remover also customers that has a value on "Trasporti" (first row) and not in "Magazzino" (second row).

So I lose some sustomers from the list and I get only the ones that have some values in "Magazzino"...

Hi @pasno ,

To remove rows with a value of 0 in Power BI without affecting other data, you can use a filter on your matrix visual. 

Firstly you can create a new measure that will check for non-zero values in the columns.

NonZeroCheck =
IF ( [Passivo Trasporti] > 0 || [Passivo Magazzino] > 0, TRUE, FALSE )

This measure returns TRUE if there’s a non-zero value in either “Passivo Trasporti” or “Passivo Magazzino”. Add this measure to the filters pane in your matrix visual. Set the filter to show items when NonZeroCheck is TRUE.

This way, you will keep rows where either “Passivo Trasporti” or “Passivo Magazzino” has a non-zero value, ensuring that customers with values in “Trasporti” are not removed when “Magazzino” is zero.

 

 

 

Best Regards

Yilong Zhou

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

Hi @v-yilong-msft ,

thank you for your feedback.

 

I understand your answer but I need to remove the row "Passivo Magazzino" every time it is 0.

For one customer that has a value in "Trasporti" but 0 in "Magazzino" I need to see just one line with the value but not the "Magazzino" line if it's 0.. This idea is not working ;-(

Hi @pasno ,

To remove rows with a value of 0 in Power BI, I think you can click on the matrix visual where you want to apply the filter. Go to the Filters pane on the right side of the report canvas. Under the Visual level filters, find the “Passivo Magazzino” field. Set the filter to show items when the value is not equal to 0.

For the scenario where you have a customer with a value in “Trasporti” but 0 in “Magazzino”, and you want to display only the “Trasporti” line, you would need to apply a similar filter to the “Passivo Magazzino” field. However, if these are two separate fields and you want to maintain the visibility of “Trasporti” values, you might need to consider creating a measure that checks the value of “Magazzino” and only returns the “Trasporti” value if “Magazzino” is 0.

Here is a change about the DAX code.

Trasporti Value = 
IF(
    SUM('Table'[Passivo Magazzino]) = 0,
    SUM('Table'[Passivo Trasporti]),
    BLANK()
)

If you can provide me about your .pbix file, I will have a further study.

 

 

 

Best Regards

Yilong Zhou

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

Hi @v-yilong-msft 

thank you again for your support.

I'm still stuck also with this solution. Please find below the pbix in which ou can find one customer that has this feature (so a value in "Trasporti" but not in "Magazzino").

https://we.tl/t-4nE6QjJJlg

 

I'd like to see only the row with the value and not the one with 0.

 

Thank you very very much again,

Daniele

Hi @pasno ,

I opened your .pbix file but I do not know which Measure should I select. When I select all of the Trasporti and Magazzino, it gives me blank on Magazzino,with no zero on Magazzino but has number on Trasporti . Colud you tell me more about this?

 

 

 

Best Regards

Yilong Zhou

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

Hi @v-yilong-msft 

in the pbix you can fine one customer "Acqua" with the two metrics that shows the costs (Passivo trasporti and Passivo Magazzino).

pasno_0-1709819783653.png

 

This is the case in which I have a value only in the "Trasporti" area but not in the "Magazzino" one, so I expect to see just one row, the one with values.

But if I add a filter to remove "Passivo Magazzino" when it's 0 or null it doesn't work!

pasno_1-1709820144424.png

 

 

 

 

Hi @pasno ,

I looked at the structure in detail and realized that Trasporti and Magazzino are one and the same in matrix, and even with filters they can not change.

vyilongmsft_1-1709889956908.png

vyilongmsft_0-1709889492126.png

So I think it is more difficult to try to implement it in matrix, but it would be easier to choose table visual.

vyilongmsft_2-1709890095558.png

 

 

 

Best Regards

Yilong Zhou

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

Hi @v-yilong-msft 

Thank again for your feedback. The only reason I'm trying to do this is to have a vertical table instead of an horizontal one 🙂

 

Talk to you soon and have a nice day!

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.