What if you could instantly see how your business is growing year after year without tedious manual work?
Why Year-over-year comparison in Tableau? - Purpose & Use Cases
Start learning this pattern below
Jump into concepts and practice - no test required
Imagine you have sales data in a spreadsheet for multiple years. To see how sales changed from one year to the next, you try to manually calculate the difference for each product and month by copying and pasting formulas across many rows and columns.
This manual method is slow and tiring. You might make mistakes copying formulas or referencing wrong cells. It's hard to update when new data arrives, and comparing many years becomes confusing and error-prone.
Year-over-year comparison in Tableau automatically calculates and visualizes changes between the same periods in different years. It updates instantly with new data and shows clear trends without manual formula copying.
=(B2-B14)/B14 // Excel formula comparing this year to last year
LOOKUP(SUM([Sales]), -12) // Tableau calculation for previous year sales
You can quickly spot growth or decline trends year after year, making smarter business decisions faster.
A retail manager uses year-over-year comparison to see if holiday sales improved this year compared to last year, helping plan inventory and marketing.
Manual year-over-year calculations are slow and error-prone.
Tableau automates these comparisons with dynamic calculations.
This helps reveal clear trends and supports better decisions.
Practice
Solution
Step 1: Understand year-over-year comparison
Year-over-year comparison is used to see how a value changes from one year to the next.Step 2: Identify the correct purpose
Comparing values from one year to the previous year matches the definition of year-over-year comparison.Final Answer:
To compare values from one year to the previous year -> Option AQuick Check:
Year-over-year = compare year to previous year [OK]
- Confusing year-over-year with total yearly sales
- Thinking it filters data instead of comparing years
- Assuming it only shows current year data
Solution
Step 1: Identify function for previous value
LOOKUP() function in Tableau returns a value from a previous or next row, useful for previous year values.Step 2: Confirm correct function
WINDOW_SUM() sums over a window, DATEPART() extracts date parts, SUM() totals values, but only LOOKUP() fetches previous year value directly.Final Answer:
LOOKUP() -> Option DQuick Check:
Previous year value = LOOKUP() [OK]
- Using SUM() instead of LOOKUP() for previous year
- Confusing DATEPART() with fetching previous values
- Using WINDOW_SUM() which sums but doesn't get previous year
SUM([Sales]) - LOOKUP(SUM([Sales]), -1)What does this calculation return?
Solution
Step 1: Analyze the calculation components
SUM([Sales]) gives current year sales; LOOKUP(SUM([Sales]), -1) fetches previous year sales.Step 2: Understand the subtraction
Subtracting previous year sales from current year sales gives the difference in sales year-over-year.Final Answer:
The difference in sales between the current year and the previous year -> Option BQuick Check:
Current year sales - previous year sales = difference [OK]
- Thinking it calculates percentage growth
- Assuming it returns only previous year sales
- Confusing it with total sales calculation
Solution
Step 1: Identify common error in LOOKUP calculations
LOOKUP depends on table calculation direction; if not set to Year, it fetches wrong rows.Step 2: Confirm why direction matters
Setting compute using Year ensures LOOKUP moves along years, giving correct previous year values.Final Answer:
The table calculation direction is not set to compute using Year -> Option CQuick Check:
Wrong direction = wrong previous year value [OK]
- Ignoring table calculation direction
- Changing aggregation from SUM to AVG unnecessarily
- Assuming missing fields cause LOOKUP errors
(SUM([Sales]) - LOOKUP(SUM([Sales]), -1)) / LOOKUP(SUM([Sales]), -1) * 100
Solution
Step 1: Understand the calculation formula
The formula calculates difference divided by previous year sales, then multiplies by 100 for percentage.Step 2: Identify potential issue
If previous year sales are zero, division by zero occurs causing error or infinite result.Step 3: Evaluate other options
WINDOW_SUM is not needed here; adding 1 is incorrect for percentage growth calculation.Final Answer:
This calculation will cause a division by zero error if previous year sales are zero -> Option AQuick Check:
Division by zero risk if previous year sales = 0 [OK]
- Ignoring division by zero possibility
- Replacing SUM with WINDOW_SUM unnecessarily
- Adding 1 incorrectly in percentage formula
