---
schema_version: "1"
id: 336961244d48cc48cc8cdae1133f2c1e8f4b3a6e01f1ce5d39b84857c7d45afb
title: Customize Table Calculations
collection: tableau
version: current
locale: en-us
portal_url: https://docs.salesforce.com/tableau/current/en-us/pro/desktop/calculations_tablecalculations_custom.md
canonical_url: https://help.tableau.com/current/pro/desktop/en-us/calculations_tablecalculations_custom.htm
source_site: help.tableau.com
content_type: documentation
content_hash: c11dabecb5e0f5459aeafbb95f8ee6f762eb72211ebbe4ed51f3c8231ebc3834
description: Customize table calculations with the Compute Using dropdown and build nested table calculations.
---
[Skip to main content](#main-content)

# Customize Table Calculations

You can always customize a table calculation by editing it in the Table Calculations dialog box, but there are other, more specialized ways to customize a table calculation.

## Customizing a Table Calculation Using Its Context Menu

Click any field in the view to see a context menu listing ways to customize the field. For a field in the view that has a table calculation, you can change the Compute Using option—that is, the option that determines the direction and scope of the calculation relative to the visual structure of the view. Do this by clicking the field and then choosing an option from the Compute Using list.

For Difference From, Percent Difference From, and Percent From table calculations, you can also specify a different field from which the difference should be computed. Do this by clicking the field and then choosing an option from the Relative to list. The options are Previous, Next, First, and Last.

## Customizing a Table Calculation Using the Calculation Editor

You can customize a table calculation by dragging it into the calculation editor:

![The calculation editor showing the underlying calc for a table calc](/tableau/current/en-us/pro/desktop/en-us/Img/table_calculations_customize1.png)

When you edit a table calculation in the calculation editor, you can click Default Table Calculation in the lower-right corner of the editor to open the calculation in the Table Calculation dialog box. This will allow you to create a new named calculated field that uses the same table calculation as the one you are basing the calculation on.

## Nested Table Calculations

A nested table calculation can be one of two types of calculated fields:

- A calculated field that includes more than one calculated field with a table calculation (as in the example below), or
- A calculated field that itself has a table calculation and includes at least one calculated field with a table calculation.

With nested table calculations, you can set Compute Using configurations for individual calculations independently.

Here is a scenario you can try, using the Sample - Superstore data source that is included with Tableau Desktop, which results in a nested table calculation.

1. Drag Sub-Category to Columns and Region to Rows.
2. Create a calculated field, _1-nest_, with the definition `TOTAL(SUM([Sales]))`.
    
    TOTAL is a table calculation function, so this calculated field automatically has a table calculation—when you use it in the view, the field will have the tell-tale table triangle, indicating a table calculation:
    
    ![A measure pill with the triangle icon indicating a table calc](/tableau/current/en-us/pro/desktop/en-us/Img/table_calculations_indicator.png)
    
    For information on table calculation functions, see [Table Calculation Functions](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_tablecalculation.htm).
3. Create a second calculated field, _2-nest_, with the definition `TOTAL(SUM([Profit]))`.
4. Create a third calculated field, _3-nest_, with the definition `[1-nest] + [2-nest]`.
5. Drag _3-nest_ and drop it to the right of `Sub-Category` on Columns.
6. Click _3-nest_ on Columns and choose Edit Table Calculation.
    
    In the Table Calculations dialog box, you can now separately configure the underlying table calculations:
    
    ![The table calc options menu showing the nested calc dropdown](/tableau/current/en-us/pro/desktop/en-us/Img/table_calculations_nest.png)