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
h1629
Frequent Visitor

How to remove Zeros in a measure

I have crated measure which is working good , but I am unable to filter the row where the measure value is zero. Through filter panel it should not be filtered. I need a DAX query to hide the last row with ID =C where measure value is 0.

Measure =
SWITCH(TRUE(),
SELECTEDVALUE('Table'[ID])="C",0,
SELECTEDVALUE('Table'[ID])=BLANK(), CALCULATE(SUMX('Table','Table'[Value]),'Table'[ID2]=BLANK(),ALLEXCEPT('Table','Table'[ID2])),
SUMX('Table','Table'[Value]))

h1629_2-1709706569094.png

 

h1629_1-1709706208416.png

 

1 ACCEPTED SOLUTION
talespin
Solution Sage
Solution Sage

hi @h1629 

 

Use this for Sum value

IF( SELECTEDVALUE('Table'[ID]) = "C", BLANK(), SUM('Table'[Value]) )
 
Use this for other measure
Measure =
SWITCH(TRUE(),
SELECTEDVALUE('Table'[ID])="C",BLANK(),
SELECTEDVALUE('Table'[ID])=BLANK(), CALCULATE(SUMX('Table','Table'[Value]), ISBLANK('Table'[ID]),ALLEXCEPT('Table','Table'[ID])),
SUMX('Table','Table'[Value]))
 
talespin_0-1709707414641.png

 

View solution in original post

2 REPLIES 2
talespin
Solution Sage
Solution Sage

hi @h1629 

 

Use this for Sum value

IF( SELECTEDVALUE('Table'[ID]) = "C", BLANK(), SUM('Table'[Value]) )
 
Use this for other measure
Measure =
SWITCH(TRUE(),
SELECTEDVALUE('Table'[ID])="C",BLANK(),
SELECTEDVALUE('Table'[ID])=BLANK(), CALCULATE(SUMX('Table','Table'[Value]), ISBLANK('Table'[ID]),ALLEXCEPT('Table','Table'[ID])),
SUMX('Table','Table'[Value]))
 
talespin_0-1709707414641.png

 

h1629
Frequent Visitor

It is a Data model , so we can canot create any flag and put it in the Filter panel to filter the rows. 

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.