Forum Discussion
Anonymous
2 years agoNot applicable
Calculate Moving Average
Hi, I have data which looks like: Site Date Value Moving Average London 01-01-2022 0.1 0.1 London 28-01-2022 0.2 0.15 London 01-02-2022 0.3 0.2 London 01-03-2022 0.6 0...
- 2 years ago
hi Anonymous ,
you may try to add a calculated column like:
Column = AVERAGEX( FILTER( data, data[Site]=EARLIER(data[Site]) &&data[Date]<=EARLIER(data[Date]) ), data[Value] )it worked like:
- 2 years ago
Moving AVG = AVERAGEX( WINDOW( 1, ABS, 0, REL, DATA, ORDERBY( DATA[Date] ), DEFAULT, PARTITIONBY( DATA[Site] ), MATCHBY( DATA[Site], DATA[Date] ) ), DATA[Value] )
VahidDM
2 years agoSuper User
Hey Anonymous
do want that as a new cal column or measure?
btw, check this link and watch Greg's video:
https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Urgent-assistance-Calculate-the-moving-average-of-a-measure/m-p/3061542
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn | Twitter | Blog | YouTube