MOD

Updated on

MOD is a DAX function that returns the remainder after a number is divided by a specified divisor.

Syntax

MOD(
   Number,
   Divisor
)
Argument Properties 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 Values

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 1

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

= MOD(3,2)

Example 2

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)

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/mod-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy