Forum Discussion

SaulM's avatar
SaulM
Frequent Visitor
4 years ago
Solved

Prior Month DAX with Measure

Hello,   I have been trying to figure out this measure for 3 days and have not gotten anywhere. I have a measure created "Total Exceptions Count" has does a countrows('ExceptionsTable') works with ...
  • mahoneypat's avatar
    4 years ago

    Here's one way to do it (with a similar approach to the measure you already have).  I used an existing model to try the approach out.  My Recent Month measure is the same but with 0 instead of -1 in the EOMONTH part.

     

    Total Sales Previous Month =
    VAR EOMmaxSalesDate =
        EOMONTH ( MAXX ( Sales, Sales[SaleDate] )-1 )
    RETURN
        CALCULATE (
            [Total Sales],
            FILTER ( ALL ( 'Date'[MonthEnding] ), 'Date'[MonthEnding] = EOMmaxSalesDate )
        )

     

    Pat