0
0
Tableaubi_tool~5 mins

Moving average in Tableau - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
A moving average smooths out data by calculating the average of a set number of points over time. It helps you see trends clearly by reducing random ups and downs in your data.
When you want to show sales trends over months without daily fluctuations.
When analyzing website traffic to see overall visitor patterns instead of daily spikes.
When comparing stock prices over time to identify general movement.
When your dashboard needs to highlight seasonal patterns by smoothing data.
When you want to reduce noise in customer satisfaction scores collected weekly.
Steps
Step 1: Open your Tableau workbook
- Tableau Desktop main window
Your data and worksheets are visible
Step 2: Drag the date field to the Columns shelf
- Columns shelf
Dates appear along the horizontal axis
Step 3: Drag the measure you want to analyze (e.g., Sales) to the Rows shelf
- Rows shelf
A line chart or bar chart shows the measure over time
Step 4: Click the measure pill on the Rows shelf to open the menu
- Rows shelf measure pill
A menu with options appears
Step 5: Select 'Quick Table Calculation' then choose 'Moving Average'
- Quick Table Calculation submenu
The chart updates to show the moving average line smoothing the data
Step 6: Click the measure pill again and select 'Edit Table Calculation' to customize
- Rows shelf measure pill menu
The Table Calculation dialog opens where you can set the number of periods for the moving average
💡 Adjust the number of previous values to average for smoother or more detailed trends
Before vs After
Before
Line chart shows daily sales with many ups and downs, making it hard to see the overall trend
After
Line chart shows a smooth curve representing the moving average of sales, making the trend clear
Settings Reference
Calculation Type
📍 Quick Table Calculation menu
Choose the type of calculation to apply to your measure
Default: None
Moving Average Period
📍 Edit Table Calculation dialog
Set how many data points to include in the moving average calculation
Default: 2
Compute Using
📍 Edit Table Calculation dialog
Define the direction or dimension over which the calculation is performed
Default: Table (Across)
Common Mistakes
Applying moving average without setting the correct compute direction
The calculation may average data incorrectly across wrong dimensions, causing misleading results
Use 'Edit Table Calculation' to set 'Compute Using' to the correct dimension, usually the date field
Using too few periods for moving average
The line remains too jagged and does not smooth the data effectively
Increase the number of periods in the moving average to better smooth fluctuations
Summary
Moving average smooths data to reveal trends by averaging values over time.
Use Tableau's Quick Table Calculation to add moving averages easily.
Remember to set the correct compute direction and period length for accurate results.