Forum

Conversion of table...
 
Notifications
Clear all

Conversion of table by using power query

3 Posts
2 Users
0 Reactions
138 Views
(@jp)
Posts: 2
New Member
Topic starter
 

Dear Friends,

I would like to get your suggestions to solve the following problem by using M Code or power query.

How to pack the items of Table 1 in  minimum number of carton subject to

1. Total weight in a carton should be max of 25 kgs.

2. In a caton max 5 items can be inluded.

3.The final table to be sorted from smallest to largest based on Pack No.

 

Thanks

JP

 
Posted : 13/06/2020 7:40 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi JP,

Power Query isn't really the tool for this.  This is an optimization problem you should do in Excel.

It's not clear if this is a one off problem or something you'll do ongoing?

As a one off you can do it 'manually', I've come up with a different solution to you but the same number of packs - see attached.

Why does a table of results have to be sorted?  Sounds like something you;d be asked to do for homework???

Regards

Phil

 
Posted : 13/06/2020 8:04 am
(@jp)
Posts: 2
New Member
Topic starter
 

Dear Phil,

Thanks for your reply on my topic.

Actually  I given a simple table to get a solution. This is one of the requirement of a project , which I am working on.

The data in the table will vary and some time , it will go up to 50 items. I want to automate the process of making the  packs with max 25 KG & with max 5 items. In fact I got a solution by using formulas ( aggregate & Index) which is quite long and difficult to trace the mistakes. I thought with power query, the solution may be simpler & easy to automate.

Pl let me know, your solution. Some body told me that by using solver, solutions can be made.

Any way I am using Excel 2016  with out power pivot.

Looking for your reply.

Thanks

Jp

 
Posted : 13/06/2020 9:44 am
Share: