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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
ak77
Post Patron
Post Patron

Hide row if all the measure values=0

Hi all,

 

I have a matrix table with 20 columns calculated as measures .

i want to hide the rows which are zero for all 20 column values . is there any common way of handling this case in DAX? please help  

3 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @ak77 
You can create Flag measure :

test = if ([measure1]=0&& [measure 2]=0&& [measure 2 ]=0,..........[measure 20] =0,1,0)
Use this measure as a filter for your matrix.
I created an example with other numbers just to show you the logic:
Ritaf1983_0-1696480822806.png

You can download the pbix From this link 

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Hi @ak77 

Unfortunately, since your condition uses an 'and' relationship and you want to filter out rows only when all measures are blank, I don't believe there is a simpler solution. According to the dataset, the issue may not be related to size but rather to other measures.

Please take a look at the linked video; you might find something that can help

https://www.youtube.com/watch?v=b2b-z5Iv-cM

 

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

try this

IF ( MAX ('table'[Asset I Sub-Class]) = "ExcessReturns",0,1)

View solution in original post

9 REPLIES 9
Ahmedx
Super User
Super User

Flag =
VAR _AllMeasures = [measure 1]+[measure 2]+ [measure 3] ..... [measure 20]
RETURN
if( _AllMeasures > 0 ,1)
-----------

this will help you filter the matrix in visual filter level just select 1

@Ahmedx thanks for reply.. i tried the above solution as mentioned. there are some constraints.

 

1.All my measure has '--' character and addition of measures breaks while summing up. 

2. its a large dataset ( 3 million + records) and resulting in resource exceed errors) in published version? 

everything in your report is amazing!
how are these measures and how can you look at 3 mellions in the matrix and how do you have records
and there are not zeros but --
you show us the screenshot

ak77_0-1696946627119.png

@Ahmedx , pls see the screenshot.. 3 million in total . we have a 10 year annual return measure where 10 years data sum is calcualted.. 

try this

IF ( MAX ('table'[Asset I Sub-Class]) = "ExcessReturns",0,1)

@Ahmedx , Sorry.. i didnt get .. how will IF ( MAX ('table'[Asset I Sub-Class]) = "ExcessReturns",0,1) help in hiding the row if all values are zero. Please let me know

ak77
Post Patron
Post Patron

@Ritaf1983 , this works for smaller datasets.. i have a 3 million data and on trying this it gives exceeded memory error. is there a way to calculate if all columns =0 in a dynamic way instead of having all columns in IF condition. Please check

Ritaf1983
Super User
Super User

Hi @ak77 
You can create Flag measure :

test = if ([measure1]=0&& [measure 2]=0&& [measure 2 ]=0,..........[measure 20] =0,1,0)
Use this measure as a filter for your matrix.
I created an example with other numbers just to show you the logic:
Ritaf1983_0-1696480822806.png

You can download the pbix From this link 

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @ak77 

Unfortunately, since your condition uses an 'and' relationship and you want to filter out rows only when all measures are blank, I don't believe there is a simpler solution. According to the dataset, the issue may not be related to size but rather to other measures.

Please take a look at the linked video; you might find something that can help

https://www.youtube.com/watch?v=b2b-z5Iv-cM

 

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.