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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
vincentakatoh
Helper IV
Helper IV

DAX: Exclude if Count is ZERO

Hi, 

Need help on DAX to exclude if Count= zero. Using below DAX formula.

 

1) PRT0_CFnFail = sum(Data[CountFnF]) <Sum of Count>

2) PRT1_AllDefectsFn = CALCULATE([PRT0_CFnFail],ALL(Data[FailDefectCode])) <Sum of all rows>

 

Currently the DAX in (2), list all rows even if (1) = zero.

 

Que: How can I change (2) to exclude rows when (1) equals to zero. Objective is to exclude rows if count is zero. 

 

2017-07-04 00_56_05-GPAUS 0629 - Power BI Desktop.png

 

1 ACCEPTED SOLUTION
kschaefers
Resolver I
Resolver I

You can modify your DAX formula for (2) to  be:

PRT1_AllDefectsFn = IF(ISBLANK([PRT0_CFnFail]),BLANK(),CALCULATE([PRT0_CFnFail],ALL(Data[FailDefectCode])))

View solution in original post

2 REPLIES 2
kschaefers
Resolver I
Resolver I

You can modify your DAX formula for (2) to  be:

PRT1_AllDefectsFn = IF(ISBLANK([PRT0_CFnFail]),BLANK(),CALCULATE([PRT0_CFnFail],ALL(Data[FailDefectCode])))
cs_skit
Resolver IV
Resolver IV

Make Count Measure

 

Put Count Measure in Filter <> 0

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors