Dax Function: TAN
Category: Mathematical and Trigonometric Functions
The TAN function in Power BI is a mathematical DAX function used to calculate the tangent of a given angle. The angle is specified in radians, and the function outputs a scalar value.
Purpose:
- The TAN function is commonly used in trigonometric calculations and geometric analysis where the tangent ratio is needed.
Type of Calculations:
- The TAN function computes the tangent of an angle θ\theta, which is defined mathematically as:
- The result can range from negative infinity to positive infinity, depending on the input angle.
Practical Use Cases:
- Geometry: Calculating slopes, angles, or height in relation to distance in real-world contexts.
- Physics: Modeling waveforms or analyzing oscillatory systems.
- Engineering: Solve design problems involving angles and slopes.
- Data Transformation: Used in custom calculations involving trigonometry.
TAN(<number>)</number>
| Parameter | Type | Description |
|---|---|---|
number | Scalar | A numeric value representing the angle in radians for which the tangent is calculated. |
How Does TAN Dax Function Works?
The tangent function in trigonometry is the ratio of the sine to the cosine of an angle. Using the TAN function in Power BI involves:
- Converting degrees to radians (if applicable) since the function expects radians.

- Computing:

- Returning the result.
- Converting degrees to radians (if applicable) since the function expects radians.
What Does It Return?
The TAN function returns a numeric scalar value that represents the tangent of the input angle in radians. If the input angle is at π/2 + nπ (where nn is an integer), the function will return an error because the tangent is undefined at these points.
When Should We Use It?
- Modeling Geometric Relationships: Useful in calculations involving heights, distances, and angles.
- Waveforms and Periodic Data: Analyze and model data patterns in physics and engineering contexts.
- Data Scaling: Compute scaling or projections in datasets involving trigonometric relationships.
Examples
Basic Usage
Compute the tangent of π/4 radians:
Result = TAN(PI() / 4)
Output: 1 ( since tan(π/4) = 1 ).
Column Usage
Apply the tangent calculation to a column of angles in radians:
TangentValues = TAN(Angles[Radians])
Returns the tangent for each value in the Angles[Radians] column.
Advanced Usage
Combine the TAN function with other DAX functions to calculate a projection:
Projection = TAN(Values[Angle]) * Values[BaseLength]
Result: Computes the height of a projection based on the tangent of the angle and a given base length.
Tips and Tricks
- Angle Conversion: Ensure that angles are converted to radians if your input is in degrees. Use the formula:
Radians = Degrees * PI() / 180 - Avoid Undefined Values: Be cautious with inputs near π/2 + nπ, where the tangent becomes undefined.
- Combine with Other Trigonometric Functions: Use functions like SIN and COS for complementary calculations.
Performance Impact of TAN DAX Function:
- The TAN function is highly optimized for scalar calculations.
- When applied to large datasets, ensure that pre-computation of constant angle conversions (e.g., degrees to radians) is performed for efficiency.
Related Functions You Might Need
- SIN: Computes the sine of an angle.
- COS: Computes the cosine of an angle.
- PI: Returns the value of π, useful for converting degrees to radians.
- ATAN: Computes the arctangent (inverse tangent) of a value.
Want to Learn More?
For more information, check out the official Microsoft documentation for TAN. You can also experiment with this function in your Power BI reports to explore its capabilities.
If you’re looking to unlock the full potential of Power BI and take your data insights to the next level, our expert Power BI consulting services are here to help. Whether you need assistance with implementing advanced DAX functions like the ones discussed here, creating interactive dashboards, or optimizing your data models for better performance, our team of seasoned Power BI consultants is ready to provide tailored solutions for your business. Visit our Power BI Consulting page to learn more about how we can empower your organization with data-driven decisions.
The TAN function calculates the tangent of a given angle in radians.
Use the formula 
The function returns an error if the input angle is π/2 + nπ, as tangent is undefined at these points.
Yes, the TAN function can be applied to calculated columns for row-wise calculations.
The TAN function is used in geometric modeling, physics simulations, and wave analysis.