Number.Permutations
How many ways there are to pick a number of items from a set in order, when the order counts.
Group: Number. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Number.Permutations(setSize as nullable number, permutationSize as nullable number) as nullable number
| Parameter | Type | Description |
|---|---|---|
setSize | nullable number | How many items there are to pick from. |
permutationSize | nullable number | How many to pick, one after another. |
Returns
nullable number. The count of different ordered picks; 0 when more are picked than there are.
Remarks
- Both numbers must be whole and not negative: a fraction or a negative number is an error. null gives null.
- It is
Number.Combinationstimes the number of orders each choice can be put in.
Examples
Gold, silver and bronze among eight shops
Number.Permutations(8, 3)
336
First and second place among five
Number.Permutations(5, 2)
20
Twice Number.Combinations(5, 2): each pair can be put in two orders.