KNOWLEDGE BASE

Moving Average of Underlying Details Instead of Aggregate


Published: 05 Feb 2018
Last Modified Date: 10 Jan 2019

Question

How to calculate the Moving Average on the underlying data instead of Aggregate.

Environment

Tableau Desktop

Answer

Create a calculation with the following formula (replace [Measure] with your own measure):
WINDOW_SUM(SUM([Measure]),-2,0)/
WINDOW_SUM(SUM([Number of Records]),-2,0)

Additional Information

Essentially, we are creating the average by dividing the Sum of the Measure by the Count of Records.

Discuss this article... Feedback Forum
Did this article resolve the issue?