To create a new calculated field, select Analysis > Create Calculated Field, or select Create Calculated Field on one of the Data window title menu.
The Calculated Field dialog box opens.
To define the calculation do the following:
Specify a name for the new field.
Create a formula that defines the new field. Refer to Writing for mulas in Tableau for more information about how to define a formula.
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.