Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Calculate PreviousMonth doesnt work

Hi Guys,   I tried to calculate the total purchase id from table PurchTable from the previous month. My current measure is:   Previous Month Purchase ID = CALCULATE(COUNT(PURCHTABLE[PURCHID]), P...
  • DAX0110's avatar
    DAX0110
    8 years ago

    In order to show the count of previous month's purchaseIDs on each row, you have to remove the relevant filter context using ALL:

     

    Previous Month Purchase ID

    = CALCULATE(

              COUNT(PURCHTABLE[PURCHID])

             , PREVIOUSMONTH('DATE'[Date])

             , ALL(PURCHTABLE[PURCHID])

              )