Forum Discussion
Running Total using SAMEPERIODLASTYEAR
- 6 years ago
Hi Niall ,
The formula SAMEPERIODLASTYEAR takes the same month from the previous year but it does not calculate the YTD. This is why you don't see the correct numbers.
You can try the formula below:
MonthlyTotalLastYr = CALCULATE ( [UniqueInteractionId], DATEADD(DATESYTD(Dates[Date]),-1,Year) )The formula first calculates the YTD, then the function DATEADD subtracts one year from the YTD. Therefore you obtain the YTD of the previous year.
Let me know if this fixes your problem.
Regards,
LC
Interested in Power BI templates? Check out my blog at www.finance-bi.com
Hi Niall ,
The formula SAMEPERIODLASTYEAR takes the same month from the previous year but it does not calculate the YTD. This is why you don't see the correct numbers.
You can try the formula below:
MonthlyTotalLastYr =
CALCULATE (
[UniqueInteractionId],
DATEADD(DATESYTD(Dates[Date]),-1,Year)
)The formula first calculates the YTD, then the function DATEADD subtracts one year from the YTD. Therefore you obtain the YTD of the previous year.
Let me know if this fixes your problem.
Regards,
LC
Interested in Power BI templates? Check out my blog at www.finance-bi.com
Thanks - works perfectly
- lc_finance6 years agoSolution Sage
Good to hear!
Best of luck for your analysis
LC