PowerPivot DAX: Moving Average
A quick blog post about sharing PowerPivot DAX formula to calculate moving average. Please use this as building block for your scenario:
Here’s the Data:
DATE AMOUNT 6/1/2013 50 6/2/2013 40 6/3/2013 30 6/4/2013 20 6/5/2013 10 6/6/2013 10 6/7/2013 20 6/8/2013 30 6/9/2013 40 6/10/2013 50
(usually, the date would in a date table. For the purpose of sharing building block of this formula, I kept it this way to keep it simple)
Formula (Calculated Measure):
[code language=”text”]
Moving Average Last 3 days:=CALCULATE(AVERAGE(TableName[Amt]),DATESINPERIOD(TableName[date],PREVIOUSDAY(TableName[date]),-3,day))
[/code]
Results via a Pivot Table:

Note that the formula is a building block and you’ll have to make changes as per your requirement and data model. Feel free to leave a comment if you need some assistance from my side. And also consider using the PowerPivot forum to reach out to community: MSDN Forum – PowerPivot for Excel
