Forum Discussion
Termigez
6 years agoRegular Visitor
AVERAGEX over time intervals
Hello everyone, I want to create a new calculated column that will iterate through my rows and will return an average value for current and past 2 values for each unique name taking into consideratio...
- Anonymous6 years ago
Termigez
You first need to create an Index for the [Time], so you can look back for a range, because Time type is not supportedIndex = RANKX('Table',[Time],,ASC,Dense) Result = CALCULATE(AVERAGE('Table'[Amount]),FILTER('Table',[Name]=EARLIER('Table'[Name])),FILTER('Table','Table'[Index]<=EARLIER('Table'[Index])&&'Table'[Index]>EARLIER('Table'[Index])-3))Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
6 years agoNot applicable
Termigez
You first need to create an Index for the [Time], so you can look back for a range, because Time type is not supported
Index = RANKX('Table',[Time],,ASC,Dense)
Result = CALCULATE(AVERAGE('Table'[Amount]),FILTER('Table',[Name]=EARLIER('Table'[Name])),FILTER('Table','Table'[Index]<=EARLIER('Table'[Index])&&'Table'[Index]>EARLIER('Table'[Index])-3))
Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.