Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX Help

Expired = CALCULATE(COUNT('Card Type'[CardType]) ,FILTER('Card Type' , IF([End Date] > 'Card Type'[GracePeriodEndDate] ,1,0)))

I want 0 for rows that are not satisfying the filter condition.
What else i can use instead of "FILTER" to get the result.
 
  • Anonymous

    I think:

    Expired =
    VAR __Expired = CALCULATE(COUNT('Card Type'[CardType]) ,FILTER('Card Type' , IF([End Date] > 'Card Type'[GracePeriodEndDate] ,1,0)))
    RETURN IF(ISBLANK(__Expired),0,__Expired)

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion
    Anonymous

    I think:

    Expired =
    VAR __Expired = CALCULATE(COUNT('Card Type'[CardType]) ,FILTER('Card Type' , IF([End Date] > 'Card Type'[GracePeriodEndDate] ,1,0)))
    RETURN IF(ISBLANK(__Expired),0,__Expired)