Forum Discussion
Dynamic 12 Month YTD Calculation
- 1 year ago
Hi asa70 ,
After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have modified few things in pbix and successfully implemented it.
I am also including .pbix file for your better understanding, please have a look into it:
Thank you for using Microsoft Community Forum.
Hi asa70
i don't think YTD is the appropriate term to use but instead the running 12 months total. If the goal is to show the last x months and not jut the total value, then you will need to use a disconnected table as using a related one will only alter the filter context but not the visible rows. However, if the goal is to compute the total running total for the last x months relative to the current row, please try this:
Total Revenue Last Six Months Running =
CALCULATE (
[Total Revenue],
DATESINPERIOD ( Dates[Date], MAX ( Dates[Date] ), -6, MONTH )
)
Replace 6 with 12.
Please see the attached pbix.