Forum Discussion
Willborn
Advocate III
9 years agoGoing back 2 years instead only 1
Hi there I'm using the SAMEPERIODLASTYEAR-Function. Is there a way to get the year bevor the previous year (2016 YTD + 2015 same period + 2014 same periode)? Currently in use: SaleP2YTot = C...
- 9 years ago
According to the documentation:
https://msdn.microsoft.com/en-us/library/ee634972.aspx
The dates returned are the same as the dates returned by this equivalent formula:
DATEADD(dates, -1, year)
So perhaps:
DATEADD(dates, -2, year)
Greg_Deckler
Community Champion
9 years agoAccording to the documentation:
https://msdn.microsoft.com/en-us/library/ee634972.aspx
The dates returned are the same as the dates returned by this equivalent formula:
DATEADD(dates, -1, year)
So perhaps:
DATEADD(dates, -2, year)
Willborn
Advocate III
9 years agoThank you smoupre!
SalesP2YTot = CALCULATE([SalesTot]; DATEADD(Dates[Date]; -2; year))
Did not realized that I have to replace the "sameperiodlastyear"-Function. But it's working well.
What about when calculation the cummulative sales total? Can I use the same functionality like as:
CumSalesP2YTot = CALCULATE (
[SalesPYTot];
FILTER (
ALLSELECTED(Dates);
'Dates'[Date] <= DATEADD(Dates[Date]; -1; year)
&& 'Dates'[Date] <= TODAY()
)
)
Regards Patrick