Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SammyNed
Helper I
Helper I

Combination Sum

Hi  guys,

 

Can you please assist?

I have 2 tables, Table 1 basically shows how much Customer (Column: Y-ID) spent (Column: Spend) purchasing a certain number of products( Column: Orders) under different days (Column: X-ID) 

SammyNed_0-1631126694689.png

Table 2, shows all the items (Column: Item) that were purchased by a Customer and the Cost. Table 2 has already been filtered for a particular date (X-ID = 1) and Customer (Y-ID = A).

SammyNed_1-1631126716570.png

 

I would like to know if theres any way to show which combination of items were purchased under that particular cost. Table 3 below shows a sample of what i would like. So basically Item a2 and a5 were not part of the items making up the total of R100 spent.

SammyNed_2-1631127191554.png

Is it possible?

 

Thanks in advance

 

4 REPLIES 4
Anonymous
Not applicable

"So basically Item a2 and a5 were not part of the items making up the total of R100 spent."

 

WHY NOT? What's the algorithm that lets one determine which were and which were not participating in the cost?

Unfortunately there's no particular algorhim, just need to know which Items make up the total spend.  Can be random, sometimes all the items add up to the total spend and sometimes only a few items add up to the table spend.

Anonymous
Not applicable

You're out of luck here. To determine which items could constitute the whole (without any other constraints on the problem) you'd need to check all the possible combinations of items. This is not feasible and it's not the kind of problem that PBI has been created to solve.

Thank you for your feedback. At least now I can stop banging my head against the wall trying to figure something out. 😀

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.