Number.RandomBetween Function of Power Query

The Number.RandomBetween function in Power Query returns a random number between a specified minimum and maximum value (inclusive).

Syntax

Number.RandomBetween(
    min as number,
    max as number
) as number 

The function has the following parameters:

Note: Both min and max must be numbers, and min ≤ max.

Example: Get a random number between 1 and 5.

Power Query M

let
    Source = Number.RandomBetween(1, 5)
in
    Source    

The output of the above code is:
2.546797