Professional Documents
Culture Documents
4understanding Calculations in Tableau - Tableau
4understanding Calculations in Tableau - Tableau
Understanding Calculations in
Tableau
Version: 2021.1
Calculations allow you to create new data from data that already exists in your
data source, as well as perform computations on your data. This allows you to
perform complex analyzes and add fields to your data source on your own and
on the fly.
To segment data
To convert the data type of a field, such as converting a string to a date.
To aggregate data
To filter results
https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_understand.htm 1/4
6/14/2021 Understanding Calculations in Tableau - Tableau
To calculate ratios
The data you need for your analysis is missing from your data source.
For example, if you have a Sales and Profit field in your data source, but
you want to calculate cost, you can create a Cost field using a formula
similar to the following.
[Sales] - [Profit]
For example, you might want to calculate the difference in profit from one
year to the other. You can use a quick table calculation to show the
difference in profit in the visualization.
https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_understand.htm 2/4
6/14/2021 Understanding Calculations in Tableau - Tableau
For example, you might want to quickly color the data in your
visualization as profitable or nonprofitable. You can create a calculated
field using a calculation similar to the following and then add it to Color
on the Marks card.
IF SUM([Profit]) > 0
THEN "Profitable"
ELSE "Nonprofitable"
END
https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_understand.htm 3/4
6/14/2021 Understanding Calculations in Tableau - Tableau
Types of Calculations
(calculations_calculatedfields_understand_types.htm)
Choosing the Right Calculation Type
(calculations_calculatedfields_understand_which.htm)
Tips for Learning How to Create Calculations
(calculations_calculatedfields_understand_formulas.htm)
https://help.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_understand.htm 4/4