PowerBI

Complete Guide to DAX Mathematical Functions with Power BI Examples

🧮 Comprehensive Guide to DAX Mathematical Functions with Practical Examples

The Data Analysis Expressions (DAX) language is a powerful tool for data modeling and analysis in Power BI, Excel, and other Microsoft data platforms. This blog provides a complete guide to the mathematical functions in DAX, complete with practical examples and Power BI-friendly syntax.

📊 DAX Mathematical Function Practice Table

This table is a quick-reference guide to help you practice common DAX mathematical functions directly inside Power BI or Excel PowerPivot. You can test these expressions in calculated columns or measures.

Function DAX Expression Expected Result
ABS ABS(-5) 5
ACOS ACOS(1) 0
ACOSH ACOSH(2) 1.3169
ACOT ACOT(1) 0.7854
ACOTH ACOTH(2) 0.5493
ASIN ASIN(1) 1.5708
ASINH ASINH(1) 0.8814
ATAN ATAN(1) 0.7854
ATANH ATANH(0.5) 0.5493
CEILING CEILING(4.3, 1) 5
CONVERT CONVERT("123", INTEGER) 123
COS COS(0) 1
COSH COSH(0) 1
COT COT(1) 0.6421
COTH COTH(2) 1.0373
CURRENCY CURRENCY(1234.56) $1234.56
DEGREES DEGREES(3.14) 180
DIVIDE DIVIDE(10, 2) 5
EVEN EVEN(3) 4
EXP EXP(1) 2.7183
FACT FACT(5) 120
FLOOR FLOOR(7.4, 1) 7
GCD GCD(8, 12) 4
INT INT(5.9) 5
ISO.CEILING ISO.CEILING(4.3, 1) 5
LCM LCM(4, 6) 12
LN LN(2.7183) 1
LOG LOG(100, 10) 2
LOG10 LOG10(1000) 3
MOD MOD(10, 3) 1
MROUND MROUND(10, 3) 9
ODD ODD(2) 3
PI PI() 3.1416
POWER POWER(2, 3) 8
QUOTIENT QUOTIENT(10, 3) 3
RADIANS RADIANS(180) 3.1416
RAND RAND() Random 0–1
RANDBETWEEN RANDBETWEEN(1, 10) 1–10
ROUND ROUND(3.14159, 2) 3.14
ROUNDDOWN ROUNDDOWN(3.7, 0) 3
ROUNDUP ROUNDUP(3.1, 0) 4
SIGN SIGN(-5) -1
SIN SIN(0) 0
SINH SINH(1) 1.1752
SQRT SQRT(16) 4
SQRTPI SQRTPI(2) 2.5066
TAN TAN(0) 0
TANH TANH(1) 0.7616
TRUNC TRUNC(3.9) 3

Tip: Try using these functions in your own Power BI reports using calculated columns, or test in DAX Studio for learning.

 

Next up in this series: DAX Statistical & Aggregation Functions!

✅ Power Query Math Functions – Description, Syntax, and Examples

Use these expressions inside Power Query → Add Column → Custom Column to transform numerical data effectively.

✅ ABS

Description: Returns the absolute (positive) value.
Expression:

Number.Abs([Value])

Example: If [Value] = -5 → result = 5

✅ ACOS

Description: Returns the arccosine (inverse cosine) in radians.
Expression:

Number.Acos([Value])

Example: If [Value] = 1 → result = 0

✅ ASIN

Description: Returns the arcsine (inverse sine) in radians.
Expression:

Number.Asin([Value])

Example: If [Value] = 1 → result = 1.5708

✅ ATAN

Description: Returns the arctangent (inverse tangent) in radians.
Expression:

Number.Atan([Value])

Example: If [Value] = 1 → result = 0.7854

✅ COS

Description: Returns the cosine of the angle in radians.
Expression:

Number.Cos([Value])

Example: If [Value] = 0 → result = 1

✅ SIN

Description: Returns the sine of the angle in radians.
Expression:

Number.Sin([Value])

Example: If [Value] = 0 → result = 0

✅ TAN

Description: Returns the tangent of the angle in radians.
Expression:

Number.Tan([Value])

Example: If [Value] = 0 → result = 0

✅ EXP

Description: Returns e raised to the power of the number.
Expression:

Number.Exp([Value])

Example: If [Value] = 1 → result = 2.7183

✅ LN

Description: Returns the natural logarithm (base e).
Expression:

Number.Ln([Value])

Example: If [Value] = 2.7183 → result = 1

✅ LOG10

Description: Returns the base-10 logarithm.
Expression:

Number.Log10([Value])

Example: If [Value] = 1000 → result = 3

✅ LOG

Description: Returns the logarithm to the specified base.
Expression:

Number.Log([Value], 10)

Example: If [Value] = 100 → result = 2

✅ MOD

Description: Returns the remainder after division.
Expression:

Number.Mod([Value], 3)

Example: If [Value] = 10 → result = 1

✅ ROUND

Description: Rounds to a given number of decimal places.
Expression:

Number.Round([Value], 2)

Example: If [Value] = 3.14159 → result = 3.14

✅ ROUNDDOWN

Description: Rounds down toward zero.
Expression:

Number.RoundDown([Value])

Example: If [Value] = 3.7 → result = 3

✅ ROUNDUP

Description: Rounds up away from zero.
Expression:

Number.RoundUp([Value])

Example: If [Value] = 3.1 → result = 4

✅ POWER

Description: Raises a number to a power.
Expression:

Number.Power([Value], 3)

Example: If [Value] = 2 → result = 8

✅ SQRT

Description: Returns the square root.
Expression:

Number.Sqrt([Value])

Example: If [Value] = 16 → result = 4

✅ PI

Description: Returns the constant π.
Expression:

Number.PI

Example: Result = 3.1416

✅ RADIANS

Description: Converts degrees to radians.
Expression:

[Value] * Number.PI / 180

Example: If [Value] = 180 → result = 3.1416

✅ INT

Description: Returns the integer part (rounds down).
Expression:

Number.RoundDown([Value])

Example: If [Value] = 5.9 → result = 5

✅ SIGN

Description: Returns 1, 0, or -1 based on the sign of the number.
Expression:

if [Value] > 0 then 1 else if [Value] < 0 then -1 else 0

Example: If [Value] = -5 → result = -1

 


Note: When using these expressions in Power Query → Add Custom Column, do not prefix with =. Just copy and paste the inner formula as shown.

Leave a Reply

Your email address will not be published. Required fields are marked *