Forum Discussion
SUMX Date Range and SAMEPERIODLASTYEAR
- 5 years ago
Dalla_Terra , It this moment I am not sure any value add "values" is doing(May be you want add the in grand total and this will do that.
Sumx(Values(Dates[Year]),TOTALYTD(sum('Sales'[Price]),Dates[Date]))
so you can try for last year and check is that can work
Sumx(Values(Dates[Year]),TOTALYTD(sum('Sales'[Price]),dateadd(Dates[Date],-1,year)))
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
After taking a break and coming back to things the answer was very simple so I am adding it in the event others have a similar issue.
My current period formula, which is driven by a date slider to select the range is: Sumx(Values(Dates[Year]),TOTALMTD(Sum('Sales'[Price]),Dates[Date]))
For this same range in the previous period I only needed to add a filter to my date in the TOTALMTD function so that it reads as follows:
Sumx(Values(Dates[Year]),TOTALMTD(Sum('Sales'[Price]),SAMEPERIODLASTYEAR(Dates[Date])))
- Anonymous5 years agoNot applicable
Hi Dalla_Terra ,
Thanks for sharing your solution. Could you please mark your post as Answered? It will help the others in the community find the solution easily when they face the same problem with you. Thank you.
Best Regards