0
0
Tableaubi_tool~7 mins

Year-over-year comparison in Tableau - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
Year-over-year comparison helps you see how a number changes from one year to the next. It is useful to understand growth or decline over time, like comparing sales this year to last year.
When you want to compare this year’s sales to last year’s sales to check growth.
When you need to show how website visitors changed from one year to the next.
When your manager asks if profits improved compared to the previous year.
When you want to highlight seasonal trends by comparing the same month in different years.
When you want to track yearly changes in customer counts or product orders.
Steps
Step 1: Open your Tableau workbook
- Tableau Desktop main window
Your data and sheets are visible for analysis
Step 2: Drag the date field to the Columns shelf
- Columns shelf
Dates appear as a timeline across the top of the view
Step 3: Right-click the date field on Columns shelf and select 'Exact Date', then right-click again and choose 'Discrete'
- Columns shelf date field context menu
Dates show as individual years on the axis
Step 4: Drag the measure you want to compare (e.g., Sales) to the Rows shelf
- Rows shelf
A bar or line chart shows the measure values by year
Step 5: Create a calculated field for Year-over-Year change
- Data pane → right-click → Create Calculated Field
A new field window opens to enter the formula
💡 Use the formula: (SUM([Measure]) - LOOKUP(SUM([Measure]), -1)) / LOOKUP(SUM([Measure]), -1)
Step 6: Name the calculated field 'YoY Change' and click OK
- Calculated Field dialog
The new YoY Change field appears in the Data pane
Step 7: Drag the 'YoY Change' field to the Rows shelf next to your measure or to the Tooltip shelf
- Rows shelf or Tooltip shelf
The view updates to show year-over-year change values or shows them when hovering over data points
Before vs After
Before
The chart shows total sales for each year: 2019 = 100,000; 2020 = 110,000; 2021 = 105,000
After
The chart shows total sales and year-over-year change: 2020 = +10%, 2021 = -4.5%
Settings Reference
Date field type
📍 Columns shelf → right-click date field
Controls how dates are grouped and displayed for comparison
Default: Year (Discrete)
Calculation formula
📍 Calculated Field dialog
Defines how year-over-year change is calculated
Default: None
Measure aggregation
📍 Rows shelf → measure field
Determines how data values are summarized for each year
Default: SUM
Common Mistakes
Using continuous date instead of discrete year
Continuous dates show a timeline that can confuse year-over-year comparisons
Use discrete year to clearly separate each year on the axis
Not using LOOKUP function in the calculation
Without LOOKUP, the calculation cannot compare current year to previous year
Use LOOKUP(SUM([Measure]), -1) to get the previous year's value
Placing the YoY calculation on the wrong shelf
If placed incorrectly, the calculation may not display or update properly
Place the YoY Change field on Rows shelf or Tooltip shelf for correct visualization
Summary
Year-over-year comparison shows how a measure changes from one year to the next.
Use discrete year dates and a calculated field with LOOKUP to create the comparison.
Place the YoY calculation on the view to see percentage changes clearly.