Forum Discussion
Sal1037
Advocate II
6 years agoSameperiodlastyear - Leap Year
-I have a report with 3 columns (Date, System Sales, System Sales LY) -The goal is to compare Day to Day Sales from this year to Last year. -I have used the basic DAX for the Sales calculation ...
- Anonymous6 years agoThis is the correct behaviour. This is how it should be. The last day of the month is compared to the last day of the month of the prior year. This is what time-intel means. If you want to override this, you'll need to write your own piece of logic that'll deal with Feb 29. Rather easy to do.
Sal1037
Advocate II
6 years agoHi Alex, Thanks for the quick response.
-I have tried the DATEADD. It gave me the same outcome as the 'Sameperiodlastyear'
-I called it 'SystemSales LY_2'. The DAX formula is: System Sales LY_2 = CALCULATE([System Sales],DATEADD(DateDimension[Date],-1,YEAR))
Please see the attached screenshot for reference.
-Just to be sure, I have checked both 'Sales table' and 'Date dimension table. Neither tables have the date '2/29/2019' as it does not exist. Thus there is no data associated for that date '2/29/2019'. However, I believe due to the leap year of 2/29/2020, PBI is auto-populating value for it.
Anonymous
6 years agoNot applicable
This is the correct behaviour. This is how it should be. The last day of the month is compared to the last day of the month of the prior year. This is what time-intel means. If you want to override this, you'll need to write your own piece of logic that'll deal with Feb 29. Rather easy to do.