Forum Discussion
How To Find A Combinations That Equal A Given Sum
Hello,
I would like to find a combination of values that equals a given sum of values. Basically reproduce this :
How to find all combinations that equal a given sum in Excel? (extendoffice.com)
But in Power BI.
Thanks for your help.
Kind regards,
Ben
- Anonymous3 years ago
It is not possible to write a DAX script that finds all possible combinations of numbers that can be equal to a specific value, such as 480. This is because the number of possible combinations can be very large, and DAX is not designed to handle such large datasets.
Instead, you can use a different approach to solve this problem. For example, you could use a programming language like Python to write a script that generates all possible combinations of numbers from a given list and checks if any of the combinations are equal to the target value. This approach would require some programming knowledge and may not be suitable for all use cases.
Alternatively, you could use a tool like Excel to solve this problem. Excel has a built-in function called COMBIN that can be used to generate all possible combinations of numbers from a given list. You can then use the SUM function to check if any of the combinations are equal to the target value. This approach may be easier to implement, but it may not be suitable for very large datasets.
In summary, it is not possible to write a DAX script to find all possible number combinations that can be equal to a specific value, but there are other approaches that you can use depending on your specific needs and requirements.
1 Reply
- AnonymousNot applicable
It is not possible to write a DAX script that finds all possible combinations of numbers that can be equal to a specific value, such as 480. This is because the number of possible combinations can be very large, and DAX is not designed to handle such large datasets.
Instead, you can use a different approach to solve this problem. For example, you could use a programming language like Python to write a script that generates all possible combinations of numbers from a given list and checks if any of the combinations are equal to the target value. This approach would require some programming knowledge and may not be suitable for all use cases.
Alternatively, you could use a tool like Excel to solve this problem. Excel has a built-in function called COMBIN that can be used to generate all possible combinations of numbers from a given list. You can then use the SUM function to check if any of the combinations are equal to the target value. This approach may be easier to implement, but it may not be suitable for very large datasets.
In summary, it is not possible to write a DAX script to find all possible number combinations that can be equal to a specific value, but there are other approaches that you can use depending on your specific needs and requirements.