Forum Discussion
Anonymous
3 years agoNot applicable
Rolling next 8-week average
Hi all, I was struggling to figure out how to get an average demand from next 8 weeks, if the remainging weeks are less than 8 weeks, then calculate average based on the number of remaining weeks...
FreemanZ
Super User
3 years agohi Anonymous
you may also try to add a column like this:
Avg_Demand2 =
VAR _week = WEEKNUM([Week])
RETURN
AVERAGEX(
FILTER(
TableName,
WEEKNUM(TableName[Week])<=_week+8
&&WEEKNUM(TableName[Week])>_week
),
TableName[Demand]
)
it worked like this:
- Padycosmos3 years ago
Solution Sage
Hope this helps