Create a Simple Calculated Field - Tableau
help.tableau.com › current › proIn 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 a formula. This example uses the following formula: SUM([Profit])/SUM([Sales])
Aggregate Functions in Tableau - Tableau
help.tableau.com › current › proIn Tableau Desktop, connect to the Sample - Superstore saved data source, which comes with Tableau. Navigate to a worksheet and select Analysis > Create Calculated Field. In the calculation editor that opens, do the following: Name the calculated field Margin. Enter the following formula: IIF(SUM([Sales]) !=0, SUM([Profit])/SUM([Sales]), 0)