Forum Discussion
Anonymous
8 years agoNot applicable
Moving Average without dates
Hi, I need to calculate simple moving average for certain dates that do not come into succession, just an average of previous 3 figures, then for next figures, etc.. With date formatted column DA...
- 8 years ago
HI Anonymous
One approach is to add an Index column and then use that to generate your "last three items" average. I have attached a PBIX file (you can hide the Index col if you like).
The index calculated column can be added like this
Index = RANKX('Table1','Table1'[Date],,ASC)With the moving average column using it in this way
Moving Average = VAR MyIndex = Table1[Index] VAR myResult = AVERAGEX( FILTER( 'Table1', 'Table1'[Index] > MyIndex-3 && 'Table1'[Index] <= MyIndex ),'Table1'[Value] ) RETURN FIXED(myResult,2)
Hassan_BR
4 years agoRegular Visitor
Thanks for the suggestion! How do I resolve the same question, using moving standart deviation? I tried to substitute AVERAGEX for STDEVX.P, but the result was not correct.
Hassan_BR
4 years agoRegular Visitor
I believe I've found my mistake. I had to fill the blank values with 0 and use STDEVX.S