---
schema_version: "1"
id: 6b4e688779d475ad7e718e095667e6a40895aef80d4c725645c7c86744311b28
title: Understanding Calculations in Tableau
collection: tableau
version: next
locale: en-us
portal_url: https://docs.salesforce.com/tableau/next/en-us/public/desktop/calculations_calculatedfields_understand.md
canonical_url: https://help.tableau.com/v0.0/public/desktop/en-us/calculations_calculatedfields_understand.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 0daa4cb51eb8a2b8717c41e3d52d59ff324db336dc11de98b2981cc71682579e
description: Understand why and when to use calculations to create new data in Tableau.
---
[Skip to main content](#main-content)

# Understanding Calculations in Tableau

This series introduces the basics of understanding calculations in Tableau. In this topic, you'll learn why and when to use calculations.

## Why use calculations

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.

## When to use calculations

The first hurdle to learning calculations in Tableau is to recognize when you actually need to use one. You can use calculations for many, many reasons. Some examples might include:

- 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
- To calculate ratios

Some common scenarios might include:

- 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]`
    
    ![Create a Cost field using a formula.](/tableau/next/en-us/public/desktop/en-us/Img/calcs_understand_when2.gif)
- You want to transform values in your visualization.
    
    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.
    
    ![Create a quick table calculation.](/tableau/next/en-us/public/desktop/en-us/Img/calcs_understand_when3.gif)
- You want to quickly categorize data.
    
    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`
    
    ![Create a calculated field in Tableau.](/tableau/next/en-us/public/desktop/en-us/Img/calcs_understand_when1.gif)

  

## Other articles in this section