COMBIN DAX Function (Statistical)
Returns the number of combinations for a given number of items. Use COMBIN to determine the total possible number of groups for a given number of items.
Syntax
Parameter | Attributes | Description |
---|---|---|
Number |
The number of items. |
|
Number_chosen |
The number of items in each combination. |
Return values
Returns the number of combinations for a given number of items.
Remarks
Numeric arguments are truncated to integers.
If either argument is nonnumeric, COMBIN returns the #VALUE! error value.
If number < 0, number_chosen < 0, or number < number_chosen, COMBIN returns the #NUM! error value.
A combination is any set or subset of items, regardless of their internal order. Combinations are distinct from permutations, for which the internal order is significant.
The equation for the number of combinations is: P( n, k ) = n! / ( k! ( n – k)! )
This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.
Examples
-- COMBIN returns the number of possible combinations of -- a given number of items WITHOUT repetitions. -- The internal order is not relevant. -- Use PERMUT for the number of permutations, -- where the internal order is relevant. -- -- Use COMBINA to compute combinations WITH repetitions. -- -- COMBIN implements this calculation: -- P(n,k) = n! / k!(n-k)! -- -- For example, consider 3 elements ( A, B, C ) -- COMBIN ( 3, 2 ) returns 3 counting: -- ( A, B ) -- ( B, C ) -- ( A, C ) EVALUATE { ( "COMBIN ( 3, 1 )", COMBIN ( 3, 1 ) ), ( "COMBIN ( 3, 2 )", COMBIN ( 3, 2 ) ), ( "COMBIN ( 3, 3 )", COMBIN ( 3, 3 ) ), ( "COMBIN ( 4, 1 )", COMBIN ( 4, 1 ) ), ( "COMBIN ( 4, 2 )", COMBIN ( 4, 2 ) ), ( "COMBIN ( 4, 3 )", COMBIN ( 4, 3 ) ), ( "COMBIN ( 4, 4 )", COMBIN ( 4, 4 ) ) }
Value1 | Value2 |
---|---|
COMBIN ( 3, 1 ) | 3 |
COMBIN ( 3, 2 ) | 3 |
COMBIN ( 3, 3 ) | 1 |
COMBIN ( 4, 1 ) | 4 |
COMBIN ( 4, 2 ) | 6 |
COMBIN ( 4, 3 ) | 4 |
COMBIN ( 4, 4 ) | 1 |
Related functions
Other related functions are:
Last update: Oct 3, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo, Kenneth Barber,
Microsoft documentation: https://docs.microsoft.com/en-us/dax/combin-function-dax