Table of contents
TOC
Collapse the table of content
Expand the table of content

MOD Function (DAX)

Owen Duncan|Last Updated: 10/5/2018
|
1 Contributor

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

TermDefinition
numberThe number for which you want to find the remainder after the division is performed.
divisorThe number by which you want to divide.

Return Value

A whole number.

Remarks

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

The MOD function can be expressed in terms of the INT function: MOD(n, d) = n - d*INT(n/d)

Example

The following formula returns 1, the remainder of 3 divided by 2.

=MOD(3,2)  

Example

The following formula returns -1, the remainder of 3 divided by 2. Note that the sign is always the same as the sign of the divisor.

=MOD(-3,-2)  

See Also

Math and Trig Functions (DAX)
ROUND Function (DAX)
ROUNDUP Function (DAX)
ROUNDDOWN Function (DAX)
MROUND Function (DAX)
INT Function (DAX)

© 2018 Microsoft