Forum Discussion
jeffwash666
2 years agoNew Member
Rolling average with multiple tanks
My data looks like this: Tank Date Level Tank 1 8/3/2024 1 Tank 1 8/4/2024 2 Tank 1 8/5/2024 1 Tank 2 8/3/2024 10 Tank 2 8/4/2024 ...
- Anonymous2 years ago
Hi jeffwash666 ,
I create a table as you mentioned.
Then I create a calculated column and here is the DAX code.
Rolling7DayAvg = CALCULATE ( AVERAGE ( 'Table'[Level] ), DATESINPERIOD ( 'Table'[Date], 'Table'[Date], -7, DAY ), ALLEXCEPT ( 'Table', 'Table'[Tank] ) )Finally you will get what you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
2 years agoNot applicable
Hi jeffwash666 ,
I create a table as you mentioned.
Then I create a calculated column and here is the DAX code.
Rolling7DayAvg =
CALCULATE (
AVERAGE ( 'Table'[Level] ),
DATESINPERIOD ( 'Table'[Date], 'Table'[Date], -7, DAY ),
ALLEXCEPT ( 'Table', 'Table'[Tank] )
)
Finally you will get what you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- jeffwash6662 years agoNew Member
Brilliant, thanks so much!!