0
0
Tableaubi_tool~10 mins

Custom table calculation scope in Tableau - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sales data by Region and Category

CellValue
A1Region
B1Category
C1Sales
A2East
B2Furniture
C2100
A3East
B3Office Supplies
C3150
A4East
B4Technology
C4200
A5West
B5Furniture
C5120
A6West
B6Office Supplies
C6180
A7West
B7Technology
C7220
Formula Trace
WINDOW_SUM(SUM([Sales]))
Step 1: SUM([Sales]) for each row
Step 2: WINDOW_SUM(SUM([Sales])) over entire table
Step 3: WINDOW_SUM(SUM([Sales])) partitioned by Region
Step 4: WINDOW_SUM(SUM([Sales])) partitioned by Region and Category
Cell Reference Map
    A       B               C
1 |Region | Category      | Sales
2 | East  | Furniture    | 100  
3 | East  | Office Supplies | 150  
4 | East  | Technology   | 200  
5 | West  | Furniture    | 120  
6 | West  | Office Supplies | 180  
7 | West  | Technology   | 220  

Arrows: WINDOW_SUM uses SUM([Sales]) from column C
Partitions can be by column A (Region) or columns A+B (Region+Category)
Cells referenced are the Sales values in column C, grouped by Region and Category in columns A and B
Result
    A       B               C       D
1 |Region | Category      | Sales | Window Sum
2 | East  | Furniture    | 100   | 450
3 | East  | Office Supplies | 150   | 450
4 | East  | Technology   | 200   | 450
5 | West  | Furniture    | 120   | 520
6 | West  | Office Supplies | 180   | 520
7 | West  | Technology   | 220   | 520
Column D shows WINDOW_SUM(SUM([Sales])) partitioned by Region, summing sales within each Region group
Sheet Trace Quiz - 3 Questions
Test your understanding
What does WINDOW_SUM(SUM([Sales])) calculate when no partition is set?
ASum of all sales in the entire table
BSum of sales per Region
CSum of sales per Category
DSum of sales per row
Key Result
WINDOW_SUM aggregates SUM([Measure]) over a defined partition or entire table