Number.Permutations

Number

Returns the number of permutations for choosing k items from a set of n items, where order matters (P(n,k)).

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Number.Permutations(setSize as nullable number, permutationSize as nullable number) as nullable number

Parameters

NameTypeRequiredDescription
setSizenumberYesThe total number of items in the set (n). Must be a non-negative integer.
permutationSizenumberYesThe number of items to arrange (k). Must be a non-negative integer <= setSize.

Return Value

numberThe number of ordered arrangements P(n,k) = n! / (n-k)!.

Remarks

Number.Permutations computes P(n, k) — the number of distinct ordered arrangements of permutationSize items drawn from a set of setSize items. Unlike Number.Combinations, order matters: selecting item A then B is a different outcome than B then A.

The formula is: P(n, k) = n! / (n − k)!

The relationship between permutations and combinations is: P(n, k) = C(n, k) × k!, because for each combination of k items, there are k! ways to arrange them. Number.Permutations(n, k) is always ≥ Number.Combinations(n, k) (equal only when k = 0 or k = 1).

Special cases: P(n, 0) = 1 (one way to arrange nothing), P(n, n) = n! (total orderings of the full set). When permutationSize > setSize, the result is 0 (impossible).

Use Number.Permutations when order is meaningful: race placements, password combinations, scheduling sequences, or any scenario where the same items in a different order count as a distinct outcome.

Examples

Example 1: Ordered arrangements of 3 items chosen from 5

Result
Result
160

Example 2: How many ways can 3 runners finish 1st, 2nd, 3rd from 8 competitors?

Result
Result
1336

Example 3: Compare permutations vs combinations — ratio equals k!

#table(
    {"Measure", "Value"},
    {
        {"Combinations C(8,3)", Number.Combinations(8, 3)},
        {"Permutations P(8,3)", Number.Permutations(8, 3)},
        {"Ratio P/C = k! = 3!", Number.Permutations(8, 3) / Number.Combinations(8, 3)}
    }
)
Result
Measure
Value
1Combinations C(8,3)56
2Permutations P(8,3)336
3Ratio P/C = k! = 3!6

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks