0
0
Tableaubi_tool~8 mins

Moving average in Tableau - Dashboard Guide

Choose your learning style9 modes available
Dashboard Mode - Moving average
Dashboard Goal

Understand sales trends over time by showing monthly sales and their 3-month moving average.

Sample Data
MonthSales
2024-01100
2024-02150
2024-03130
2024-04170
2024-05160
2024-06180
2024-07200
Dashboard Components
  • Line Chart: Shows monthly sales and 3-month moving average.
    Tableau Calculation for 3-month moving average:
    WINDOW_AVG(SUM([Sales]), -2, 0)

    This calculates the average sales for the current month and previous two months.
  • KPI Card: Displays latest month sales (July 2024) = 200.
  • Data Table: Shows Month, Sales, and Moving Average values.
    Moving Average values for sample data:
    • 2024-01: 100 (only one month available)
    • 2024-02: (100+150)/2 = 125
    • 2024-03: (100+150+130)/3 = 126.67
    • 2024-04: (150+130+170)/3 = 150
    • 2024-05: (130+170+160)/3 = 153.33
    • 2024-06: (170+160+180)/3 = 170
    • 2024-07: (160+180+200)/3 = 180
Dashboard Layout
+----------------------+----------------------+
|      KPI Card        |                      |
|  Latest Month Sales  |                      |
+----------------------+----------------------+
|                      Line Chart (Sales & MA) |
|                                              |
|                                              |
+----------------------------------------------+
|               Data Table                      |
+----------------------------------------------+
    
Interactivity

User can filter by date range using a date slider. When the date range changes, the line chart, KPI card, and data table update to show only the selected months.

This helps focus on specific periods and see how the moving average adapts.

Self Check

If you add a filter to show only months from 2024-03 to 2024-06, which components update?

  • The line chart updates to show sales and moving average only for March to June.
  • The KPI card updates to show sales for June 2024 (180).
  • The data table updates to list only rows for March, April, May, and June with recalculated moving averages based on filtered data.
Key Result
Monthly sales and 3-month moving average trend with latest month sales KPI and detailed data table.