Daily DAX : Day 414 SQRT
DAX Function: SQRT
Returns the square root of a number.
Syntax
SQRT(<number>)
Parameters
| Parameter | Description |
|---|---|
| <number> | The number for which you want the square root. Must be a non-negative number. |
Return Value
A decimal number representing the square root of the given number.
Note: If the input is negative, SQRT returns a blank (or an error in some contexts).
Common Use Cases
- Calculating distances using the Pythagorean theorem (e.g., diagonal of a rectangle)
- Computing standard deviation components or volatility in financial models
- Geometry calculations (area of circles from diameter, etc.)
- Normalizing or scaling data
- Reverse-engineering squared values (e.g., getting original quantity from area or variance)
Examples
1. Simple Square Root
Square Root of 16 = SQRT(16) -- Returns 4
2. Calculate Diagonal of a Rectangle (Pythagorean Theorem)
Diagonal =
SQRT(
POWER([Width], 2) +
POWER([Height], 2)
)
3. Safe SQRT (Avoid Errors on Negative Values)
Safe Square Root =
IF(
[Value] >= 0,
SQRT([Value]),
BLANK()
)
4. Distance from Origin in 2D
Distance from (0,0) =
SQRT( [X]^2 + [Y]^2 )
Tip: Always ensure the input to SQRT is non-negative to avoid blank results in reports.
Comments
Post a Comment