If your data source doesn’t include the fields you are looking for, you can create a tableau Calculated Field. This article will show you how to create a calculated field using the Analysis Menu and the Measures section with an example.
For this Calculated Field demonstration, we will use the data source we created in our previous article. So, please visit the Data Labels in Reports article to understand the Tableau Data Source.
How to Create a Calculated Field in Tableau?
You can create a calculated field in multiple ways. The first approach is: Please navigate to the Analysis Tab and select the Create Calculated Field… option. Once you click on the Create option, a new window will open to write the calculation.

The second approach to creating a Tableau Calculated Field is to click the Down arrow beside the Sales Amount Measure (change as per your requirement). Or right-click on it to open the context menu. Please select the Create option from the list of available options and then select the Calculated Field… option, as shown below.
Once you click on the option, a new window will open to write the calculation. Use this calculation editor to write functions.
If you know the calculated field formula, you can write directly on that Measure or any other Measure. Otherwise, click on the side arrow to list all the functions available.
If you know the function name, search for the item in the search box. If you don’t know, click the down arrow, select the function type, and see the definition. In this Tableau field example, we will calculate the Running Total, so we are using the RUNNING_SUM function. Here, you can see an example to understand the syntax of a function.
Double-clicking on it will automatically add the function to the calculated region. From the screenshot below, you can observe that we changed the name to Sales Running Sum.
Now you can see our newly created calculated field under the measures. We created one table report to show our newly created calculated field result. As you can see, the last column displays the Running Total.
How to Edit Calculated Field in Tableau?
To change the existing table calculation, click on the down arrow beside the table calculation and select the Edit.. option.
Once you click the Edit.. option, the following window will be opened to edit the existing calculation or function.
Let us change the calculated field function name from RUNNING_SUM to RUNNING_AVG. Or write your custom function on the calculation editor and click OK.
Now, you can see that the last column in our report displays the Running Average calculation.
Comments are closed.