0
0
Tableaubi_tool~8 mins

Year-over-year comparison in Tableau - Dashboard Guide

Choose your learning style9 modes available
Dashboard Mode - Year-over-year comparison
Dashboard Goal

Compare sales performance this year versus last year to see growth or decline.

Sample Data
YearMonthSales
2023Jan1000
2023Feb1200
2023Mar1300
2022Jan900
2022Feb1100
2022Mar1250
Dashboard Components
  • KPI Card: Total Sales This Year
    Formula: SUM(IF [Year] = 2023 THEN [Sales] ELSE 0 END)
    Result: 3500
  • KPI Card: Total Sales Last Year
    Formula: SUM(IF [Year] = 2022 THEN [Sales] ELSE 0 END)
    Result: 3250
  • KPI Card: Year-over-Year Growth %
    Formula: ((SUM(IF [Year] = 2023 THEN [Sales] ELSE 0 END) - SUM(IF [Year] = 2022 THEN [Sales] ELSE 0 END)) / SUM(IF [Year] = 2022 THEN [Sales] ELSE 0 END)) * 100
    Result: 7.69%
  • Line Chart: Monthly Sales Comparison
    X-axis: Month
    Y-axis: Sales
    Lines: One for 2023, one for 2022
    Shows monthly sales trends side by side
  • Table: Sales by Year and Month
    Columns: Year, Month, Sales
    Shows raw sales numbers for detail
Dashboard Layout
+----------------------+----------------------+
| Total Sales This Year | Total Sales Last Year |
|        (KPI)          |        (KPI)          |
+----------------------+----------------------+
| Year-over-Year Growth % (KPI)               |
+---------------------------------------------+
|                                             |
|           Monthly Sales Comparison           |
|               (Line Chart)                   |
|                                             |
+---------------------------------------------+
|                                             |
|             Sales by Year and Month          |
|                   (Table)                    |
|                                             |
+---------------------------------------------+
    
Interactivity

A year filter lets you select one or both years. Selecting a single year updates KPIs and the table to show only that year's data. The line chart updates to show monthly sales for the selected years. Hovering over points on the line chart highlights the corresponding month in the table for easy comparison.

Self Check

If you add a filter to show only Year = 2023, which components update and how?

  • The Total Sales This Year KPI shows 3500.
  • The Total Sales Last Year KPI hides or shows 0 because 2022 is filtered out.
  • The Year-over-Year Growth % KPI recalculates or hides because last year data is missing.
  • The Monthly Sales Comparison line chart shows only the 2023 line.
  • The Sales by Year and Month table shows only 2023 rows.
Key Result
Dashboard comparing monthly and total sales for 2023 versus 2022 with growth percentage.