Number.Factorial
1 × 2 × 3 … up to the number: how many orders that many things can be put in.
Group: Number. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Number.Factorial(number as nullable number) as nullable number
| Parameter | Type | Description |
|---|---|---|
number | nullable number | The number to work on; null gives null. |
Returns
nullable number. The product of the whole numbers from 1 to the number; 1 for 0; null for null.
Remarks
- The answer grows very fast: 20 already gives more than two billion billion.
Examples
Routes through four deliveries
Four stops can be driven in this many different orders.
Number.Factorial(4)
24
Nothing to order
Number.Factorial(0)
1