Forum Discussion
stino123
Helper II
4 years agoPY YTD function is not working
Hey All, I am trying to create last year YTD functions. the function I am trying to use is the following Discount YTD PY = CALCULATE([Discount ex VAT],DATESYTD(DATEADD(Kalender[Date],-1,year...
- Anonymous4 years ago
Hi stino123 ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure = CALCULATE( SUM('Table'[amount]), FILTER(ALL('Table'), 'Table'[date]>=DATE(YEAR(MAX('Table'[date]))-1,1,1)&& 'Table'[date]<=DATE(YEAR(MAX('Table'[date]))-1,MONTH(MAX('Table'[date])),DAY(MAX('Table'[date])))))2. Result:
If I have misunderstood your meaning, please provide your desired output and your pbix without privacy information.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
johnt75
Super User
4 years agoTry
Discount YTD PY = CALCULATE([Discount ex VAT], SAMEPERIODLASTYEAR(DATESYTD(Kalender[Date])))