Calculations in Tableau
Agata Bak-Geerinck
Senior Data Analyst, Telenet
Calculations allow you to create new data from data that already exists in your data source and perform computations on your data
Typical use-cases:
Measure missing in original dataset:
Sales
and Costs
but no Profit
measure Transforming existing data:
First name
from First and Last name
Age
into "Kids", "Teens", "Adults", based on age thresholdsThere are four main types of calculations:
Basic calculations:
Advanced calculations:
Row-level calculations
End Date
-Start Date
SUM()
, AVG()
Sum of Profit
= SUM(Sales)
- SUM(Cost)
Do NOT mix up row-level and aggregate calculations:
ELSEIF
or END
in an IF()
statement{}
, []
, ()
Tableau validity check does NOT eliminate all errors!
Typical logical / mathematical errors:
AND
and OR
statementsIF
and CASE
statementsFinal analytical responsibility lies with you!
Calculations in Tableau