Forum Discussion

dsandip's avatar
dsandip
Frequent Visitor
3 years ago
Solved

CALCULATE function is not working

Hi, I using below DAX: Cureent Quarter Sales = CALCULATE([Sales Amount],     FILTER(ALL('Calendar'), 'Calendar'[Current QTD] = 1) ) and want to calculate values for [Current QTD] = 1 only and f...
  • Greg_Deckler's avatar
    Greg_Deckler
    3 years ago

    dsandip OK, it's incorrect but what is your definition of correct? Maybe this?

    Current Quarter Sales = 
      VAR __Current = MAX( 'Calendar'[Current QTD] )
      VAR __Result = IF( __Current = 1, CALCULATE([Sales Amount], FILTER(ALL('Calendar'), 'Calendar'[Current QTD] = 1)), 0 )
    RETURN
      __Result