Create a Simple Calculated Field
Sometimes your data source does not contain a field (or column) that you need for your analysis. For example, your data source might contain fields with values for Sales and Profit, but not for Profit Ratio. If this is the case, you can create a calculated field for Profit Ratio using data from the Sales and Profit fields.
This topic demonstrates how to create a simple calculated field using an example.
Step 1: Create the calculated field
- In a worksheet in Tableau, select Analysis > Create Calculated Field.
- In the Calculation Editor that opens, give the calculated field a name. In this example, the calculated field is called Profit Ratio.
Step 2: Enter a formula
- In the Calculation Editor, enter the following formula:
SUM([Profit])/SUM([Sales])
Formulas use a combination of functions, fields and operators. To learn more about creating formulas in Tableau, see Formatting Calculations in Tableau(Link opens in a new window) and Functions in Tableau(Link opens in a new window).
- When finished, click OK. The new calculated field is added to the Data pane with an = in front of the data type icon to indicate it's a calculated field.
You are now ready to use the calculated field in the view.
Check your work! Watch how to create a simple calculated field in action:
See Also
Get Started with Calculations in Tableau(Link opens in a new window)
Formatting Calculations in Tableau(Link opens in a new window)
Functions in Tableau(Link opens in a new window)
Create Level of Detail Expressions in Tableau(Link opens in a new window)
Transform Values with Table Calculations(Link opens in a new window)