0
0
Tableaubi_tool~10 mins

Line charts in Tableau - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Monthly sales data for the first five months of the year.

CellValue
A1Month
B1Sales
A2Jan
B21000
A3Feb
B31500
A4Mar
B41300
A5Apr
B51700
A6May
B61600
Formula Trace
SUM([Sales]) OVER (ORDER BY [Month] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
Step 1: SUM([Sales]) OVER (ORDER BY [Month] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) at Jan
Step 2: SUM([Sales]) OVER (ORDER BY [Month] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) at Feb
Step 3: SUM([Sales]) OVER (ORDER BY [Month] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) at Mar
Step 4: SUM([Sales]) OVER (ORDER BY [Month] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) at Apr
Step 5: SUM([Sales]) OVER (ORDER BY [Month] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) at May
Cell Reference Map
    A       B
1 | Month | Sales |
2 |  Jan  | 1000  |
3 |  Feb  | 1500  |
4 |  Mar  | 1300  |
5 |  Apr  | 1700  |
6 |  May  | 1600  |

Arrows: Sales values in column B feed into the cumulative sum calculation ordered by Month in column A.
The formula references the Sales column (B2:B6) ordered by Month (A2:A6) to calculate cumulative sums for the line chart.
Result
    A       B       C
1 | Month | Sales | Cumulative Sales |
2 |  Jan  | 1000  |      1000       |
3 |  Feb  | 1500  |      2500       |
4 |  Mar  | 1300  |      3800       |
5 |  Apr  | 1700  |      5500       |
6 |  May  | 1600  |      7100       |
The final result shows cumulative sales by month. This data can be used to create a line chart showing sales growth over time.
Sheet Trace Quiz - 3 Questions
Test your understanding
What is the cumulative sales value at March?
A3800
B1300
C2500
D5500
Key Result
SUM([Measure]) OVER (ORDER BY [Dimension] ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) calculates a running total ordered by the dimension.