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
learner03
Post Partisan
Post Partisan

Countrows where 0 OR BLANK/NULL

I want to count the rows where the Sum of lines if 0 OR Blank.
I have written this below function for 0 but cannot get how to write function that says OR blank/ Null.
 
Count = CALCULATE(COUNTROWS(DISTINCT(ULDs[Location])),FILTER(ULDs,(ULDs[SUM TOTAL QTY]=0)))
1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @learner03 

 

Is your [SUM TOTAL QTY] a measure? you can do it, the performance is better

Count = 
VAR T1=ADDCOLUMNS(VALUES(ULDs[Location]),"sum",[SUM TOTAL QTY])
RETURN
COUNTROWS(T1)-COUNTROWS(FILTER(T1,[sum]<>0))

 

View solution in original post

2 REPLIES 2
Vera_33
Resident Rockstar
Resident Rockstar

Hi @learner03 

 

Is your [SUM TOTAL QTY] a measure? you can do it, the performance is better

Count = 
VAR T1=ADDCOLUMNS(VALUES(ULDs[Location]),"sum",[SUM TOTAL QTY])
RETURN
COUNTROWS(T1)-COUNTROWS(FILTER(T1,[sum]<>0))

 

This is perfect. 

Thank you so much. I wish I had this skill level 🙂

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.