Power Fx function
Mod — Power Fx function reference
Remainder after division.
Syntax
powerfx
Mod( Number, Divisor )
Examples
powerfx
Mod(17, 5)
→ 2
Zebra-striping when a row index has already been computed, e.g. via AddColumns(Sequence(...)).
powerfx
If(Mod(Index, 2) = 0, Color.White, Color.LightGray)
powerfx
Mod(RandBetween(1, 1000), 7)
Common mistakes & gotchas
- The result takes the sign of the Divisor, matching Excel — Mod(-7, 3) returns 2, not -1, which differs from some programming languages.
- Power Fx galleries expose no direct row index, so a Mod-based "every Nth item" pattern needs a precomputed index column (e.g. via AddColumns(Sequence(...))) or a value already present in the data.
Related Power Fx functions
From Math & aggregation