OpenBI Docs Buy

COMBIN

The number of ways to choose a number of items from a set, order not counting.

Group: Math. Compatible with DAX.

Syntax

COMBIN ( <number>, <number_chosen> )
ParameterTypeDescription
numberWhole numberHow many items there are to choose from.
number_chosenWhole numberHow many of them are chosen.

Returns

Number. How many different groups of that size can be picked, the order inside a group not counting.

Remarks

  • From five beers, COMBIN ( 5, 2 ) gives the 10 different pairs.
  • Both numbers are rounded to whole numbers first, a half away from zero: 5.5 counts as 6, so COMBIN ( 5.5, 2 ) gives 15.
  • Choosing none or all gives 1. A negative number, or choosing more items than there are, is an error.
  • When the order counts, use PERMUT; when an item may be picked more than once, COMBINA.

Examples

Pairs, poker hands and a rounded count

EVALUATE
ROW (
    "Pairs of 5", COMBIN ( 5, 2 ),
    "Hands of 5 from 52", COMBIN ( 52, 5 ),
    "Of 5.5, 2", COMBIN ( 5.5, 2 )
)
Pairs of 5Hands of 5 from 52Of 5.5, 2
10259896015

Three ways to count three of ten

EVALUATE
ROW (
    "COMBIN", COMBIN ( 10, 3 ),
    "PERMUT", PERMUT ( 10, 3 ),
    "COMBINA", COMBINA ( 10, 3 )
)
COMBINPERMUTCOMBINA
120720220

COMBINA, PERMUT, FACT.

Last updated · OpenBI Studio 0.3.74