How do I calculate mat in dax for same period last year. Suppose current mat will be calculated for 2018 Aug - 2019 sep Same period last year will be calculated for 2017 Aug - 2018 sep
0
votes
1 Answers
1
votes
If you have a working [MAT] like in your comment, you should be able to just wrap it in a CALCULATE
with SAMEPERIODLASTYEAR
. See below:
MAT =
CALCULATE (
SUM ( 'SillyFact'[Amount] ),
DATESINPERIOD ( 'DimDate'[Date], LASTDATE ( 'DimDate'[Date] ), -1, YEAR )
)
MAT Prior = CALCULATE( [MAT], SAMEPERIODLASTYEAR ('DimDate'[Date] ) )
See them working below in a dummy model:
PARALLELPERIOD
orSAMEPERIODLASTYEAR
orDATEADD
orPREVIOUSYEAR
– greggyb