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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vsp_p1
Frequent Visitor

Hide matrix rows where all columns have value 0

Dear experts,

 

Link to pbix: https://drive.google.com/file/d/1g36HsepbL5tGJxrTESIxF4ueV4dlXQuo/view?usp=sharing

 

I'm trying to build a report to show the movement of items for the past 4 weeks (Movement = [Total Available Curr. Week] - [Total Available Last Week]) in a matrix visual. In some of the cases, there are no movements in ALL THE FOUR WEEKS, so the values are 0 FOR ALL THOSE WEEKS. I don't want those rows to appear in the matrix.

 

I tried filtering [Movement] <> 0 in the filter pane, but that removes the rows where at least one value is 0.

 

The pbix is available at the link above. Can you experts help me find a solution to my problem?

 

PS: I have added notes in the pbix to make it easier.

 

Regards, Vidyadutt

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

Hi @vsp_p1 ,

 

Thank you @KRISHP1234  for your reply and solution. He is valid when both [Available] and [Available LW] are 0.
If your [Available] is some other value but the difference is 0, you can refer to the following solution:

 

(1)Create measures.

Measure = var a=ADDCOLUMNS(CROSSJOIN(ALLSELECTED('Product'[Product Name]),ALLSELECTED('Week'[Week Name])),"move",[Movement])
var b=SUMX(FILTER(a,[Product Name] in VALUES('Product'[Product Name])&&[Week Name] in VALUES(Week[Week Name])&&[move]<>0),[move])
return b
Flag = 
IF([Measure]=BLANK(),0,1)

(2)Place [Flag=1] on the visual object filter.

vtangjiemsft_0-1714122683276.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

3 REPLIES 3
vsp_p1
Frequent Visitor

Thank you @KRISHP1234 and @v-tangjie-msft.

 

The solution by @KRISHP1234 worked in the sample dataset, but it didn't work in my actual dataset as there were many more combinations.

 

The one from @v-tangjie-msft works like a charm 🙂

v-tangjie-msft
Community Support
Community Support

Hi @vsp_p1 ,

 

Thank you @KRISHP1234  for your reply and solution. He is valid when both [Available] and [Available LW] are 0.
If your [Available] is some other value but the difference is 0, you can refer to the following solution:

 

(1)Create measures.

Measure = var a=ADDCOLUMNS(CROSSJOIN(ALLSELECTED('Product'[Product Name]),ALLSELECTED('Week'[Week Name])),"move",[Movement])
var b=SUMX(FILTER(a,[Product Name] in VALUES('Product'[Product Name])&&[Week Name] in VALUES(Week[Week Name])&&[move]<>0),[move])
return b
Flag = 
IF([Measure]=BLANK(),0,1)

(2)Place [Flag=1] on the visual object filter.

vtangjiemsft_0-1714122683276.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. 

KRISHP1234
Frequent Visitor

Use This Measure
Movement =
VAR a = [Available]
VAR b =[Available LW]
VAR c =  [Available] - [Available LW]
RETURN
SWITCH(TRUE(),
        a = 0 && b = 0,BLANK(),
     c
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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