0
0
Tableaubi_tool~10 mins

Year-over-year comparison in Tableau - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sales data for two years, 2022 and 2023

CellValue
A1Year
B1Sales
A22022
B21000
A32023
B31200
Formula Trace
SUM([Sales]) - LOOKUP(SUM([Sales]), -1)
Step 1: SUM([Sales]) for current year (2023)
Step 2: LOOKUP(SUM([Sales]), -1) for previous year (2022)
Step 3: 1200 - 1000
Cell Reference Map
   A      B
1 Year   Sales
2 2022   1000
3 2023   1200

Formula references Sales in B2 and B3 for calculation.
The formula uses sales values from years 2022 and 2023 to calculate the year-over-year difference.
Result
   A      B       C
1 Year   Sales   YoY Change
2 2022   1000    
3 2023   1200    200
The YoY Change column shows the difference in sales between 2023 and 2022, which is 200.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the LOOKUP function with offset -1 do in this formula?
AGets the sales value from the previous year
BGets the sales value from the next year
CCalculates the total sales for all years
DReturns zero
Key Result
SUM([Measure]) - LOOKUP(SUM([Measure]), -1) calculates year-over-year difference