Forum Discussion
Anonymous
4 years agoNot applicable
Single value for a column cannot be determined
Hi, I am trying to create a measure so that I can calculate a rolling 4 interval average (I only have interval # and no date). However when trying to use an index to order the intervals, I recei...
- 4 years ago
Anonymous
Inside FILTER, instead of 'Rolling Table', use ALL ( 'Rolling Table' ),
tamerj1
4 years agoCommunity Champion
Anonymous
Would you please copy/paste the code here so I can edit it
Anonymous
4 years agoNot applicable
Thank you so much! Posting final DAX expression should anybody need to reference it:
Moving Average =
VAR MyIndex = selectedvalue('Rolling Table'[Index])
VAR myResult =
AVERAGEX(
FILTER(
ALL('Rolling Table'),
'Rolling Table'[Index] > MyIndex-4 &&
'Rolling Table'[Index] <= MyIndex
),'Rolling Table'[EDD]
)
RETURN FIXED(myResult,2)