Forum Discussion
nmhung49
Helper II
5 years agoCaculate same period last year
I have Data table with date 01/01/2020 to 05/31/2021 and DimDate with date 01/01/2020 to 12/31/2021 When I create Dax Same Period Last Year for result 98 is incorrect. It is correct 13 Please help ...
- 5 years ago
nmhung49
Helper II
5 years agoSorry It is show 13, I separte DimDate Table because this is the primary key table that is related to other tables I use this table to control year, month, day
ryan_mayu
Super User
5 years agoPls try this
SPLY =
VAR _MAX=MAX('Table'[Date])
RETURN CALCULATE(SUM('Table'[Sale]),FILTER(ALL('Table'),YEAR('Table'[Date])=YEAR(_MAX)-1&&MONTH('Table'[Date])<=MONTH(_MAX)))
pls see the attachment below