top of page

How to Create Calculated Fields in Tableau (Tableau Calculations)

Writer's picture: Bernard KilonzoBernard Kilonzo
tableau calculated fields

Tableau calculations help you create new data based on the existing one. A very good example of calculated field is Profit ratio – which is as a result of dividing SUM(Profit) and SUM(Sales).

You can use calculated fields in different ways, such as;

  • Segmenting data

  • Converting data type of a field – such as string to date field

  • Aggregating data

  • Filtering results

  • Calculating ratios etc.

You can build your first calculated field in Tableau as follows;

Step 1: Open the calculation editor.

You can open the calculation editor in the following three ways;

1. By going to the Analysis menu >> Create Calculated Field…

2. Right click anywhere on the dimension or measure area >> Create >> Calculated Field…

3. On the data pane – open the drop down menu on top of the dimension area >> Create Calculated Field…

tableau calculated field

Step 2: Name your calculation and enter your formula in the calculation editor

In this case, have named the calculation – Profit ratio

And used this formula - SUM(Profit)/SUM(Sales)

tableau calculation

Click okay.

Note: The new calculated field is added to the data pane either under dimensions or measures. If your calculation computes quantitative data then it’s added to the measures. If it computes qualitative data then it’s added to the dimensions.

In this case, Profit ratio is added to the measure area.

Note: The complexity of your calculation will vary depending with the type of calculation (basic, level of detail (LOD) expressions or Table calculations) and kind of challenge you’re working on.

To receive more of the Tableau tips and tricks – kindly subscribe to our mailing list below.

Thank you for reading.

Original.png

We Support You Deliver Business-Focused Solutions That Enable Data-Driven Decision Making.

  • Tableau profile
  • YouTube
  • White LinkedIn Icon
  • Facebook
  • X

QUICK LINKS

CONTACT US

+254 738 307 495

East Gate Mall, Donholm

3rd Floor Suite No. 3i

Nairobi, Kenya

Join our mailing list

bottom of page