List.Random Function of Power Query
The List.Random function returns a list of random numbers between 0 and 1, with an optional seed parameter.
Syntax
List.Random(count as number, optional seed as nullable number) as list
The function has the following parameters:
- count: The number of random values to generate.
- seed: It is an optional parameter. A numeric value used to seed the random number generator. If omitted a unique list of random numbers is generated each time we call the function. If we specify the seed value with a number every call to the function generates the same list of random numbers.
Example: Create a list of 3 random numbers.
Power Query M
let Source = List.Random(3) in Source
The output of the above code is shown below:
Example: Create a list of 5 random numbers, specifying seed value.
Power Query M
let Source = List.Random(5,78) in Source
The output of the above code is shown below: