---
schema_version: "1"
id: 7ea7d74a45da704da70d6d852d3a8305aeaafa7d99ca583669ed16c69e44ba42
title: Customise Table Calculations
collection: tableau
version: next
locale: en-gb
portal_url: https://docs.salesforce.com/tableau/next/en-gb/pro/desktop/calculations_tablecalculations_custom.md
canonical_url: https://help.tableau.com/v0.0/pro/desktop/en-gb/calculations_tablecalculations_custom.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 18a5aa493b75682c45a322a4ba31581e13da0e0d620b9caedb7ddff273945bce
description: Customize table calculations with the Compute Using dropdown and build nested table calculations.
---
[Skip to main content](#main-content)

# Customise Table Calculations

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

## Customising a Table Calculation Using Its Context Menu

Click any field in the view to see a context menu listing ways to customise 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.

## Customising a Table Calculation Using the Calculation Editor

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

![The calculation editor showing the underlying calc for a table calc](/tableau/next/en-gb/pro/desktop/en-gb/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/next/en-gb/pro/desktop/en-gb/Img/table_calculations_indicator.png)
    
    For information on table calculation functions, see [Table Calculation Functions](https://help.tableau.com/v0.0/pro/desktop/en-gb/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/next/en-gb/pro/desktop/en-gb/Img/table_calculations_nest.png)