Forum Discussion
tjowen
7 years agoRegular Visitor
Getting a running average
I have created a calculated table that contains two fields: a date (no time), and a numerical value for each date. It looks something like this: I am trying to get a running average...
- Anonymous7 years ago
Hey Tom,
By including a filter, ALL(DaySum), you will achieve the results you are looking for. See below for an example.
30 Day Average = DIVIDE( CALCULATE( SUM(DaySum[Cargo Tonnes]), ALL(DaySum), DATESBETWEEN(DaySum[Date], LASTDATE(DaySum[Date])-30, LASTDATE(DaySum[Date])) ) ,30)Kind regards,Alex
Anonymous
7 years agoNot applicable
Hey Tom,
By including a filter, ALL(DaySum), you will achieve the results you are looking for. See below for an example.
30 Day Average =
DIVIDE(
CALCULATE(
SUM(DaySum[Cargo Tonnes]),
ALL(DaySum),
DATESBETWEEN(DaySum[Date], LASTDATE(DaySum[Date])-30, LASTDATE(DaySum[Date]))
)
,30)
Kind regards,
Alex