How to Create a Calculated Field

To create a new calculated field, select Analysis > Create Calculated Field, or select Create Calculated Field on one of the Data window title menu.

A graphic depicting how to create a new calculation by selecting New Calculation from the right-click context menu in the schema.

The Calculated Field dialog box opens.

A graphic depicting the Calculation dialog box.

To define the calculation do the following:

  1. Specify a name for the new field.

  2. Create a formula that defines the new field. Refer to Writing for mulas in Tableau for more information about how to define a formula.

  3. When finished, click OK.

The new calculated field displays in either the Dimensions area or the Measures area of the Data window depending on the data type returned by the calculation. Calculations that return a string or date are dimensions, while calculations that return a number are measures. In the latter case, you can convert the measure to a dimension if you want to treat the calculated values as discrete rather than continuous.