Tableau – Table Calculation Functions
Tableau Function Categories Tableau – Table Calculation Functions Category: Table Calculation functions Table calculation functions in Tableau are post-aggregation functions that perform computations on data already present in a visualization.
Category: Table Calculation functions
Table calculation functions in Tableau are post-aggregation functions that perform computations on data already present in a visualization. Unlike basic calculations that operate at the data source level, table calculations are applied after aggregation—working on the data displayed in the view. They allow users to perform running totals, ranks, moving averages, and other advanced calculations directly on the visualization.
Purpose
The primary purpose of table calculation functions is to:
Perform advanced analytical computations such as running totals, percentages, and rankings.
Analyze data trends and comparisons dynamically across dimensions and measures.
Enable powerful in-view analysis without altering underlying data sources.
Support interactive dashboards that can adapt calculations based on sorting, filtering, and user input.
Table calculations are ideal for visual analytics where you want to understand how a data point relates to others in the same table, view, or partition.
Practical Use Cases
Trend Analysis: Calculate running totals or moving averages to identify long-term trends.
Performance Ranking: Rank salespersons, products, or regions based on performance metrics.
Growth Comparison: Compute month-over-month or year-over-year growth percentages.
Dynamic KPIs: Create metrics that adjust automatically when filters or sorting change.
Window-Based Insights: Use moving averages or rolling sums to smooth volatile data trends.
| Function | Description |
|---|---|
| FIRST() | Returns the number of rows between the current row and the first row in the partition. |
| INDEX() | Returns the position (index) of the current row within the partition, starting from 1. The index is not affected by value sorting. |
| LAST() | Returns the number of rows between the current row and the last row in the partition. |
| LOOKUP() | Returns the value of an expression in another row, identified by a relative offset from the current row. You can use expressions like FIRST() + n or LAST() - n to specify the target row. Returns NULL if the target row cannot be determined. |
| MODEL_PERCENTILE() | Returns the probability (from 0 to 1) that the predicted value is less than or equal to the observed value, based on the target expression and predictors. Represents the Posterior Predictive Distribution Function, also called the Cumulative Distribution Function (CDF). |
| MODEL_QUANTILE() | Returns a predicted numeric value at a specified quantile, within the probable range defined by the target expression and predictors. Represents the Posterior Predictive Quantile. |
| PREVIOUS_VALUE() | Returns the value of this calculation from the previous row. For the first row in the partition, it returns the specified expression instead. |
| RANK() | Returns the competition rank of the current row. Identical values receive the same rank, and the next rank is skipped. You can specify 'asc' or 'desc' for order (default is descending). |
| RANK_DENSE() | Returns the dense rank of the current row. Identical values share the same rank, but no rank numbers are skipped. Supports 'asc' or 'desc' ordering (default is descending). |
| RANK_MODIFIED() | Returns a modified competition rank where tied values receive the same rank. Supports 'asc' or 'desc' order (default is descending). |
| RANK_PERCENTILE() | Returns the percentile rank of the current row within the partition. Supports 'asc' or 'desc' order (default is ascending). |
| RANK_UNIQUE() | Returns a unique rank for each row, even if values are identical. Supports 'asc' or 'desc' order (default is descending). |
| RUNNING_AVG() | Returns the cumulative average of the expression from the first row up to the current row in the partition. |
| RUNNING_COUNT() | Returns the cumulative count of the expression from the first row up to the current row. |
| RUNNING_MAX() | Returns the highest value of the expression from the first row up to the current row. |
| RUNNING_MIN() | Returns the lowest value of the expression from the first row up to the current row. |
| RUNNING_SUM() | Returns the cumulative total of the expression from the first row up to the current row. |
| SIZE() | Returns the total number of rows in the partition. For example, if a partition has seven quarterly records, SIZE() returns 7. |
| TOTAL() | Returns the overall total for the specified expression within the table calculation partition. |
| WINDOW_CORR() | Returns the Pearson correlation coefficient for two expressions across the defined window. |
| WINDOW_COUNT() | Returns the count of the given expression within the current window. |
| WINDOW_COVAR() | Returns the sample covariance for two expressions within the window. |
| WINDOW_COVARP() | Returns the population covariance for two expressions within the window. |
| WINDOW_MEDIAN() | Returns the median value of the expression across the window. |
| WINDOW_MAX() | Returns the highest value of the expression within the window. |
| WINDOW_MIN() | Returns the lowest value of the expression within the window. |
| WINDOW_PERCENTILE() | Returns the value at the specified percentile within the window. |
| WINDOW_STDEV() | Returns the sample standard deviation of the expression within the window. |
| WINDOW_STDEVP() | Returns the population (biased) standard deviation of the expression within the window. |
| WINDOW_SUM() | Returns the total sum of the expression across the window. |
| WINDOW_VAR() | Returns the sample variance of the expression within the window. |
| WINDOW_VARP() | Returns the population (biased) variance of the expression within the window. |
Maximize the potential of Tableau and elevate your data insights with our expert consulting services. Whether you need assistance with advanced calculations, help designing interactive dashboards, or support in optimizing your data visualizations for better performance, our skilled Tableau consultants are ready to provide tailored solutions for your business. Visit our Tableau consultancy page to learn more about how we can empower your organization to make more informed, data-driven decisions.
Table Calculation functions perform computations on aggregated data in a visualization, allowing for running totals, rankings, and other advanced analytics.
Regular calculations happen at the data source level, while table calculations are computed at the visualization level after data aggregation.
Common functions include RUNNING_SUM, RANK, LOOKUP, WINDOW_AVG, and INDEX.
Yes, table calculations can be customized using partitions and addressing fields to work dynamically with filters and dimensions.
You can right-click a calculated field or measure, select “Edit Table Calculation,” and define how it computes (across table, down, or specific dimensions).