Tableau table calculations: set addressing and partitions
A Tableau table calculation transforms values in the current view’s virtual table, for example into a rank, running total, percentage, or moving calculation. It does not recalculate the entire source table. Set addressing to define the direction through marks and partitioning to define where the calculation restarts. First decide which cells belong to one calculation.
A Tableau table calculation transforms values in the current view’s virtual table, for example into a rank, running total, percentage, or moving calculation. It does not recalculate the entire source table. Set addressing to define the direction through marks and partitioning to define where the calculation restarts. First decide which cells belong to one calculation.
Dimensions in a worksheet define a virtual table of marks. Table calculations operate on values in that view, not directly on source tables. Addressing is the direction the calculation traverses, such as months for a running total. Partitioning defines groups where it calculates separately and restarts, such as each year. Every dimension in the view level of detail must be used for addressing or partitioning.
Example: monthly running total by year
For a sales table by month and year, address along month and partition by year so the cumulative total restarts each year. In Tableau Desktop, right-click SUM(Sales) and select Add Table Calculation, choose Running Total, and set Compute Using to the direction matching the table. Inspect highlighted marks and compare the final value with the group total. Tableau also permits average, minimum, or maximum for a running total, so check the aggregation option.
Example: percent of total
A percent-of-total calculation divides each mark by a chosen denominator: the whole table, row, column, pane, or a row or column within a pane. The default is percent of table. Choose Analysis > Percentages Of to select a scope. Check grand totals to verify that each intended group sums to 100%; formatting alone does not reveal the denominator.
Verify
State the unit of the question, inspect view dimensions and sort order, choose the calculation type, then check Compute Using. For complex views use Specific Dimensions: selected dimensions address, unselected dimensions partition. Add or remove a dimension and predict the effect. Test filters separately because table calculations use the current view; table-calculation filters hide marks after calculation. Check moving-window edges and tie handling for ranks. Edit with Edit Table Calculation or remove with Clear Table Calculation.
Compare raw values and results in a small crosstab. Hand-check one partition, compare the last running value to its group sum, and confirm each percentage denominator. A sound setup answers two questions: which marks does the calculation traverse, and where does it restart?
Sources
[Transform Values with Table Calculations](https://help.tableau.com/current/pro/desktop/en-us/calculations_tablecalculations.htm)
[Table Calculation Types](https://help.tableau.com/current/pro/desktop/en-us/calculations_tablecalculations_definebasic_runningtotal.htm)
[Calculate Percentages](https://help.tableau.com/current/pro/desktop/en-us/calculations_percentages_options.htm)
[Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm)