COMBINA
The number of ways to choose a number of items from a set, repeats allowed and order not counting.
Group: Math. Compatible with DAX.
Syntax
COMBINA ( <number>, <number_chosen> )
| Parameter | Type | Description |
|---|---|---|
number | Whole number | How many kinds of item there are to choose from. |
number_chosen | Whole number | How many are chosen; the same kind may be picked again. |
Returns
Number. How many different groups of that size can be picked when repeats are allowed and the order does not count.
Remarks
- Three scoops from four flavours, the same flavour allowed twice:
COMBINA ( 4, 3 )is 20. - It equals
COMBIN ( number + number_chosen - 1, number_chosen ). - Unlike
COMBIN, more may be chosen than there are kinds:COMBINA ( 2, 5 )is 6. - Both numbers are rounded to whole numbers first. Choosing 0 gives 1; a negative number is an error, and so is choosing any from 0 kinds.
Examples
With repeats allowed
EVALUATE
ROW (
"3 of 4 flavours", COMBINA ( 4, 3 ),
"As COMBIN", COMBIN ( 4 + 3 - 1, 3 ),
"5 of 2", COMBINA ( 2, 5 )
)
| 3 of 4 flavours | As COMBIN | 5 of 2 |
|---|---|---|
| 20 | 20 | 6 |