[]
        
(Showing Draft Content)

Math Functions

Mathematical functions are very similar to Excel's mathematical functions, which are used to perform basic math functionality on your data. For example, you can use mathematical functions to find the square root, round, absolute value, and so on.


Following is the list of math functions supported in Wyn Enterprise:

ABS


Description


The ABS function returns the absolute value of a number.


Syntax

ABS(<number>)

Parameters

Parameter

Description

number

The number for which you want the absolute value.

Return Value


A decimal.


Example

ABS('Sale'[Manufacturing Cost]- [Sale Price])

The above example returns the absolute value of the difference between the Manufacturing Cost and the Sale Price.


Remarks

The absolute value of a number is an integer or decimal number without negative(-) signs. If nested within a function that expects positive numbers, the ABS function can be used to ensure that only non-negative numbers are returned from expressions.

DIVIDE


Description


The DIVIDE function performs division and returns the alternate result on division by 0.


Syntax

DIVIDE(<numerator>, <denominator>)

Parameters

Parameter

Description

numerator

The dividend or number to divide.

denominator

The divisor or number to divide by.

Return Value


A decimal.


Example

DIVIDE(sum('Sale'[Amount]), Sum('Sale'[Price]))

Remarks

When the denominator is zero, the return value will be null.

MOD


Description


The MOD function returns the remainder after a number is divided by a divisor. The result always has the same sign as the divisor.


Syntax

MOD(<number>, <divisor>)

Parameters

Parameter

Description

number

The number for which you want to find the remainder after the division is performed.

divisor

The number by which you want to divide.

Return Value


A whole number.


Example

MOD('Sale'[Price], 3)

Remarks

If the divisor is 0 (zero), MOD returns an error. You cannot divide by 0.

POWER


Description


The POWER function returns the result of a number raised to a power.


Syntax

POWER(<number>, <power>)

Parameters

Parameter

Description

number

The base number, which can be any real number.

power

The exponent to which the base number is raised.

Return Value


A decimal.


Example

POWER(11, 2)

The above example returns 121.

ROUND


Description


The ROUND function rounds a number to the specified number of digits.


Syntax

ROUND(<number>, <num_digits>)

Parameters

Parameter

Description

number

The number you want to round.

num_digits

The number of digits to which you want to round. A negative value rounds digits to the left of the decimal point; a value of zero rounds to the nearest integer.

Return Value


A decimal.


Example

ROUND(3.33333, 2)

The above example returns 3.33.

SQRT


Description


The SQRT function returns the square root of a number.


Syntax

SQRT(<number>)

Parameters

Parameter

Description

number

The number for which you want the square root, a column that contains numbers, or an expression that evaluates to a number.

Return Value


A decimal.


Example

SQRT(2)

TRUNC


Description


The TRUNC function truncates a number to an integer by removing the decimal, or fractional, part of the number.


Syntax

TRUNC(<number>,<num_digits>)

Parameters

Parameter

Description

number

The number you want to truncate.

num_digits

A number specifying the precision of the truncation; if omitted, 0 (zero).

Return Value


A whole number.


Example

TRUNC(1.32,1)