Tableau Funtion: PI
Tableau Function: PI
Category: Number Functions
The PI() function in Tableau is a mathematical constant function that returns the value of π (pi), approximately 3.14159265358979.
This constant represents the ratio of a circle’s circumference to its diameter, and it is a fundamental value used in geometry, trigonometry, and various scientific calculations.
Purpose
The purpose of the PI() function is to provide a consistent mathematical constant for performing calculations involving:
Circular geometry (e.g., radius, area, circumference).
Trigonometric functions (e.g., sine, cosine).
Statistical or physics-based visualizations that require π.
This eliminates the need to manually input π’s value, ensuring precision and readability in Tableau calculations.
Type of Calculations It Performs
Category: Mathematical / Constant Function
Function Type: Scalar constant
Operation: Returns a fixed numeric constant (π ≈ 3.14159265358979)
Unlike other Tableau functions, PI() does not require any arguments — it simply provides a universal constant value.
Practical Use Cases
Calculating the circumference of a circle (
2 * PI() * r).Computing the area of a circle (
PI() * r^2).Converting between degrees and radians in trigonometric calculations.
Creating polar coordinate visualizations in Tableau.
Performing rotational or wave-based calculations in data modeling.
PI()
| Parameter | Type | Description |
|---|---|---|
| (None) | — | The PI() function does not take any parameters. It returns a constant numeric value of π. |
How It Works?
The PI() function is a built-in mathematical constant. When used in a calculated field, Tableau automatically substitutes π with its high-precision numeric value.
Mathematical Principle
![]()
You can use it in formulas such as:
Circumference:
C = 2 × π × r
Area:
A = π × r2
Example Formula
2 * PI() * [Radius]→ Calculates the circumference of a circle given its radius.
What Does It Return?
Type: Number (Float)
Value:
3.14159265358979Meaning: Returns the mathematical constant π, which can be used in any numeric calculation field.
When Should We Use It?
Use PI() when you need:
To calculate circular or rotational dimensions (radius, area, arc length).
To work with trigonometric functions (
SIN(),COS(),TAN()) that require radian-based inputs.To simulate geometric shapes or curved data plots.
To standardize calculations that involve the π constant across multiple dashboards.
Basic Usage
PI()
Result: 3.14159265358979
Explanation: Returns the mathematical constant π.
Column Usage
2 * PI() * [Radius]
Explanation: Calculates the circumference of a circle for each row in the dataset.
| Radius | Formula | Result |
|---|---|---|
| 5 | 2 × 3.14159 × 5 | 31.4159 |
| 10 | 2 × 3.14159 × 10 | 62.8319 |
Calculating Area of a Circle
PI() * ([Radius]^2)
Explanation: Returns the area for each radius.
| Radius | Formula | Result |
|---|---|---|
| 5 | 3.14159 × (5²) | 78.5398 |
| 10 | 3.14159 × (10²) | 314.1593 |
Converting Degrees to Radians
[Degrees] * (PI() / 180)
Explanation: Converts an angle in degrees to radians, necessary for trigonometric calculations.
| Degrees | Formula | Result |
|---|---|---|
| 180 | 180 × (π / 180) | 3.14159 |
| 90 | 90 × (π / 180) | 1.5708 |
Advanced Usage – Trigonometric Integration
SIN(PI() / 2)
Explanation: Returns 1, since sin(π/2) = 1.
Tips and Tricks
- Use
PI()with trigonometric functions likeSIN(),COS(), andTAN()for precise geometry-based calculations. - Always convert degrees to radians using
PI()for correct trigonometric results. - Combine
PI()with polar coordinate transformations to create circular visualizations in Tableau. - Avoid using manually rounded π values (like 3.14) — they reduce precision in repeated calculations.
PI()cannot be used with non-numeric data types (e.g., strings, dates).
Related Functions You Might Need
| Function | Purpose |
|---|---|
SIN() | Returns the sine of an angle in radians. |
COS() | Returns the cosine of an angle in radians. |
TAN() | Returns the tangent of an angle in radians. |
DEGREES() | Converts radians to degrees. |
RADIANS() | Converts degrees to radians (can be replaced using PI()). |
SQRT() | Computes the square root, often used with circle-related formulas. |
We’ve got plenty of resources to help you master Tableau functions. For more details, check out the official Tableau documentation. Or, if you’re ready for more practice, let’s dive into related functions and build your Tableau skills further!
If you’re ready to harness the full power of Tableau and elevate your data analytics capabilities, our expert Tableau consulting services are here to guide you. Whether you need support with building advanced calculated fields, creating dynamic visual dashboards, or optimizing your data sources for peak performance, our team of experienced Tableau consultants delivers customized solutions designed for your business needs. Visit our Tableau Consulting page to discover how we can help your organization turn data into impactful, insight-driven decisions.
It returns the mathematical constant π (3.14159265358979), used for circular and trigonometric calculations.
No, PI() takes no arguments and always returns a constant numeric value.
Yes, it works seamlessly with SIN(), COS(), TAN(), and other numeric functions.
Multiply degrees by (PI() / 180) to convert them into radians.
No, PI() is a constant and has zero computational overhead, even in large datasets.