Forum Discussion

vincentakatoh's avatar
vincentakatoh
Icon for Helper IV rankHelper IV
9 years ago
Solved

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. 

 

 

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

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

2 Replies

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

    PRT1_AllDefectsFn = IF(ISBLANK([PRT0_CFnFail]),BLANK(),CALCULATE([PRT0_CFnFail],ALL(Data[FailDefectCode])))
  • Make Count Measure

     

    Put Count Measure in Filter <> 0