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])))
desiree in power bi desktop, relationship view check that relation exists between two tables ie calendar table date column and date column in your sales table and for that relationship to exist you need dates in sales table for the dates in calendar table.
ankitpatira , I have already joined the dates in sales table and calendar table.... Do you have any other idea?
Thank you.
- ankitpatira10 years agoCommunity Champion
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/