Table calculations operate on the table of values already aggregated and rendered on the view. WINDOW_SUM, RUNNING_AVG, RANK, PERCENT_FROM, LOOKUP — these compute relative to other cells in the table. They are different from regular aggregations in that they happen after the aggregation phase, not before.
Quick table calcs
Right-click any measure on the view → Quick Table Calculation → choose from Running Total, Percent of Total, Rank, Percentile, Moving Average, YoY Growth, Compound Growth Rate, Year-over-Year Growth, etc. These cover 80% of common needs without writing a custom calc.
Addressing and partitioning
Every table calc has a direction (addressing) and a scope (partitioning). Right-click → Compute Using → reveals the options. Examples:
- Compute using Table (down): running total cumulates down the rows.
- Compute using Table (across): cumulates across columns.
- Compute using Pane (down): cumulates within each subgroup separately. Most common for grouped data.
- Compute using a specific dimension: e.g., compute using Date — running total accumulates by date, partitioned by everything else.
The 'why does my YoY look wrong' moment
Most YoY bugs come from wrong addressing. If you have Region and Year on Columns and you compute YoY 'Table (across)', it cumulates across all the cells in the row — including across regions. The fix: 'Compute Using → Year' makes it cumulate by year, with Region as the partition. Right answer, right partition.
Custom table calculations
// YoY growth — explicit formYoY = (SUM([Sales]) - LOOKUP(SUM([Sales]), -1)) / LOOKUP(SUM([Sales]), -1)// Moving average — 3 periods3-period MA = WINDOW_AVG(SUM([Sales]), -2, 0)// Rank by sales, descendingRank = RANK(SUM([Sales]), 'desc')
Exercise
Build a view with Date on Columns and three regions as separate lines. Add a YoY growth rate as a table calc. Test: 'Compute Using → Table' vs 'Compute Using → Date'. Which produces YoY within each region (correct) vs YoY across regions (wrong)?