Forum Discussion
mnascimento
9 years agoNew Member
Calulate moving average with datetime with 1 minute data
Hi, I have a data set where my datetime is for every 1 minute data and i need the moving average values for 15 minutes. the date related filters are just for months, days and years. Any ideas...
v-sihou-msft
9 years agoMicrosoft Employee
For your requirement, you can add an [1 min ago] column in your table like:
1 min ago = Table[DateTime]-1/(24*60)
I assume you fact data is on second level. You can create the moving average measure like below:
1 min Moving Average =
CALCULATE (
AVERAGE ( 'Table'[Amount] ),
FILTER (
ALL ( 'Table' ),
'Table'[DateTime] <= MAX ( 'Table'[DateTime] )
&& 'Table'[DateTime] >= MAX ( 'Table'[1 min ago] )
)
)
Regards,
Kolumam
7 years agoPost Prodigy
Can you please explain the formula? It works but I am not able to understand properly.
Thanks
Krishna