Forum Discussion
Last Year Year To Date summarized
- 4 years ago
Hi JWT ,
Please try the following formula:
Sales YTD LY = IF ( HASONEVALUE ( Periode[Måned] ), IF ( [Sales YTD] <> BLANK (), CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( Periode[Dato] ) ) ), CALCULATE ( [Total Sales], DATESBETWEEN ( Periode[Dato], EDATE ( MIN ( Periode[Dato] ), -12 ), EOMONTH ( MAX ( Sales[Date] ), -12 ) ) ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JWT , You should try measure like these with help from date table
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
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