Daily DAX : Day 392 DEGREES
Power BI DAX: DEGREES Function
Syntax
DEGREES(angle_in_radians)
Description
The DEGREES function converts a number representing an angle in radians to degrees.
This is useful when working with trigonometric functions in DAX (like SIN, COS, TAN), which expect or return values in radians, but you need results in degrees for reporting or calculations.
Parameters
| Parameter | Description |
|---|---|
angle_in_radians |
A real number representing an angle in radians. |
Return Value
A decimal number representing the angle in degrees.
Example 1: Basic Conversion
Convert π radians to degrees:
Degrees in DAX = DEGREES(PI())
Result: 180
Example 2: With Trigonometric Function
Calculate sine of 30° by converting to radians first:
Sine of 30° = SIN(DEGREES(30) * PI() / 180)
But to go the other way (radians → degrees):
Angle in Degrees = DEGREES(ASIN(0.5))
Result: 30
Use Cases
- Converting results from
ASIN,ACOS, orATAN(which return radians) into degrees for display. - Working with geographic data where bearing or direction is calculated in radians but reported in degrees.
- Creating custom trigonometric calculations in reports where users expect degree-based input/output.
Related Functions
RADIANS(angle_in_degrees)– Opposite ofDEGREESPI()– Returns the value of πSIN(),COS(),TAN()– Trigonometric functions (use radians)
Comments
Post a Comment