Dax Function: COMBIN
Category: Statistical Functions
The COMBIN function in Power BI calculates the number of combinations for a given number of items, taking a specified number of items at a time. A combination is a selection of items where the order does not matter.
Purpose
To compute how many ways items can be selected from a set without considering the order.
Type of Calculations
Combinatorial mathematics.
Practical Use Cases
- Analyzing scenarios in probability and statistics.
- Solving problems related to grouping or selecting subsets, such as team formation or lottery odds.
- Useful in business scenarios like product bundling, resource allocation, and market segmentation analysis.
COMBIN(number, number_chosen)
| Parameter | Type | Description |
|---|---|---|
number | Scalar | The total number of items. Must be greater than or equal to number_chosen. |
number_chosen | Scalar | The number of items to select at a time. Must be a non-negative integer. |
How Does COMBIN Dax Works
The formula used by the COMBIN function is:
Where:
n is the total number of items (
number).r is the number of items chosen at a time (
number_chosen).n! denotes the factorial of nn, which is the product of all positive integers up to nn.
Example Calculation
For COMBIN(5, 2):

What Does It Return?
The function returns an integer value:
Represents the total number of combinations possible when selecting
number_chosenitems from a set ofnumberitems.The value is always non-negative.
When Should We Use It?
To solve problems where order does not matter (e.g., selecting a committee).
In probability calculations to find the total number of outcomes for an event.
To evaluate business scenarios involving grouping or bundling without considering sequence.
Examples
Basic Usage :
Calculate the number of ways to choose 3 items from a set of 7:
COMBIN(7, 3)
Output: 35
Column Usage
Apply the function to calculate combinations dynamically for data in a column:
COMBIN(Table[TotalItems], Table[ChosenItems])
This computes combinations for each row based on the values in TotalItems and ChosenItems.
Advanced Usage
Combine COMBIN with other DAX functions for conditional calculations:
IF(COMBIN(10, 4) > 20, "Many Combinations", "Few Combinations")
This evaluates whether the number of combinations exceeds a threshold and returns a corresponding label.
Tips and Tricks
Integer Inputs: Ensure
numberandnumber_chosenare integers to avoid errors.Performance: Pre-compute combinations for large datasets or frequently used values to optimize performance.
Zero Handling:
COMBIN(n, 0)always returns 1, as there is exactly one way to select nothing.
Potential Pitfalls
Constraints: The value of
number_chosenmust not exceednumber.Factorial Limits: Extremely large values of
numbercan lead to computational limits due to factorial calculations.
Performance Impact of COMBIN DAX Function:
Efficient for small to medium datasets.
For large datasets, factorial calculations might become computationally expensive. Consider optimizations or alternative methods for approximation.
Related Functions You Might Need
Want to Learn More?
For more information, check out the official Microsoft documentation for COMBIN You can also experiment with this function in your Power BI reports to explore its capabilities.
Unlock the full capabilities of Power BI and elevate your data insights with our specialized consulting services. Whether you need guidance on advanced DAX functions like those highlighted here, support in designing interactive dashboards, or expertise in optimizing data models for enhanced performance, our experienced Power BI consultants are equipped to deliver customized solutions for your business. Explore our Power BI Consulting Services page to discover how we can help your organization make smarter, data-driven decisions.
It calculates the number of ways to choose a subset of items from a larger set without considering order.
COMBIN ignores order in selection, while PERMUT considers order.
The function will return an error since it is impossible to select more items than available.
No, both number and number_chosen must be integers.
It is used in statistics, business modeling, and probability to calculate grouping possibilities.