MOD Function (DAX)

How does the MOD function (DAX) work?

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

MOD Formula Syntax

= MOD(
     <number>, <divisor>
)

How do you use the MOD function?

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

Related Blog Posts

Related Support Forum Posts

Understanding DAX Formula
Developing Complex Dax functions

Considerations when using the MOD function

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

Related Video Tutorials

Formula examples using the MOD function

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
)

Related DAX Functions

ROUND
ROUNDUP
MROUND

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI

DOWNLOAD

To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.