Power Fx function
Rand — Power Fx function reference
Random decimal 0–1.
Syntax
powerfx
Rand()
Examples
powerfx
Rand()
→ e.g. 0.5634
powerfx
First(SortByColumns(AddColumns(Trivia, "Sort", Rand()), "Sort", SortOrder.Ascending))
powerfx
If(Rand() < 0.5, "Heads", "Tails")
Common mistakes & gotchas
- Rand() is volatile — it recalculates on every re-evaluation, so referencing it directly in a visible property (like a label's Text) changes the value on every re-render, not just once.
- For a value that stays fixed for the session/record, capture it once with Set/UpdateContext rather than referencing Rand() repeatedly.
Related Power Fx functions
From Math & aggregation