Forum Discussion
Need help - Moving Average Formula ERROR
- 10 years ago
HI, just did one of these this morning for a 6 wk rolling average $/kg:
calculate(sum(Data[Operating]),DATESBETWEEN(Data[Week start],LASTDATE(Data[Week start])-42,FIRSTDATE(Data[Week start])))
/
calculate(sum(Data[kg]),DATESBETWEEN(Data[Week start],LASTDATE(Data[Week start])-42,FIRSTDATE(Data[Week start])))
ankitpatira , I have already joined the dates in sales table and calendar table.... Do you have any other idea?
Thank you.
desiree And dates in calendar table matches with dates in sales table ?
- desiree10 years agoFrequent Visitor
ankitpatira , yes.. I used pivottable to get the unique dates from Sales table to prepare Calendar table.
- kcantor10 years agoCommunity Champion
I had the same issue. I used this blog post and made changes to my DAX. It works perfectly. I do not remember what caused my issues but here is the link to the post:
http://www.powerpivotpro.com/2013/07/moving-averages-sums-etc/