Forum Discussion

desiree's avatar
desiree
Frequent Visitor
10 years ago
Solved

Need help - Moving Average Formula ERROR

  Hello,   I am new to Power BI and DAX. I am trying to create a measure for calculating the moving average of 3 monthly sales by area on Power BI Desktop/Service. I have googled many websites but...
  • samdthompson's avatar
    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])))