OpenBI Docs Buy

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
ParameterTypeDescription
setSizenullable numberHow many items there are to pick from.
permutationSizenullable numberHow 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.Combinations times 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.

Number.Combinations, Number.Factorial.

Last updated · OpenBI Studio 0.3.79