I have attached a 4-column excel table as my dataset. I’d like to create a rolling 12 month average in which I add up everything in the Unit column that falls between the max date (4/1/2022) and 1 year prior (5/1/2021). Then I will divide this by 12.
The total units for this period should be 3643 and the 12 month average should be 304.
I was able to get the number I’m looking for by creating a measure that sums the units column, then using a date slicer to individually select 12 months back (May 2021 until April 2022 - see attached screenshot).
I’d like to recreate this result using DAX within a measure, since the max date and count of units will be constantly changing as new records are added to the dataset.
Hopefully, this makes sense and has a simple solution! I included both the dataset as well as a screenshot of how I was able to get the result I’m looking for by applying year and month filters.
In order to achieve the results based on the condition that you’ve specified. I added an active date table and other one is passive. Below is the screenshot of the data model provided for the reference -