Forum Discussion
nmhung49
5 years agoHelper II
Caculate 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
Thejeswar
5 years agoSuper User
Hi nmhung49 ,
Change the SPLY formula as follows. Also I am not really sure, why you need a separte Date Dimension Table for this functionality. Change the formula to use Date from the same table as given below
SPLY = CALCULATE(SUM(Data[Sale]),SAMEPERIODLASTYEAR(Data[Date]))
This will change the Output from 98 to 13.
Why do you expect to see 11..which the Sales for Same period last year is 13
PFB screengrab
- nmhung495 years agoHelper II
Sorry 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