Updated on

Number.RandomBetween is a Power Query M function that generates a random number between two given numbers, bottom and top. The function returns the generated random number within the specified range.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365


   bottom as number,
   top as number,
) as number


Returns a random number between bottom and top.


Get a random number between 1 and 5.

// Output: 2.546797
Number.RandomBetween( 1, 5 )

Learn more about Number.RandomBetween in the following articles:

Other functions related to Number.RandomBetween are:

BI Gorilla Blog

Contribute » | Contributors: Rick de Groot
Microsoft documentation: