Power Fx function
RandBetween — Power Fx function reference
Random whole number in range.
Syntax
powerfx
RandBetween( Bottom, Top )
Examples
powerfx
RandBetween(1, 100)
→ e.g. 42
A four-digit confirmation code.
powerfx
RandBetween(1000, 9999)
powerfx
Set(varDiceRoll, RandBetween(1, 6))
Common mistakes & gotchas
- Both Bottom and Top are inclusive, and the result is always a whole number even if Bottom/Top are decimals — they get rounded.
- Same volatility caveat as Rand() — capture the value with Set/UpdateContext if it needs to stay fixed rather than change on every re-evaluation.
Related Power Fx functions
From Math & aggregation