Forum Discussion
Djpejsen
4 years agoFrequent Visitor
Power Query - Inventory allocation
Hi Experts I have a table of Sales orders with shipments priority and requested qty. (Table A) Every week I receive a delivery plan from our vendors. (Table B) I have to provide a Shipment deliver...
- 4 years ago
Hi Djpejsen ,
Sorry for the late reply.
It is indeed not an easy case and it did take me many days.
I cant find a simpler way.Hope my way below would be a solution for you.
First go to query editor>unpivot columns to get below table:
Then in outbound table,I create several columns to tranform the data.
Finally,I got below calculated table.
Table = DISTINCT ( UNION ( SELECTCOLUMNS ( 'outbound', "Sales Order", [Sales order], "Item", 'outbound'[Item], "Proritet", 'outbound'[_proritet], "Qty", 'outbound'[final adjust], "Index", 'outbound'[Index] ), SELECTCOLUMNS ( 'outbound', "Sales Order", [Sales order], "Item", 'outbound'[Item], "Proritet", 'outbound'[new proritet], "Qty", 'outbound'[round1], "Index", 'outbound'[new index] ) ) )And you will see:
What you want is as below:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my reply as a solution!
Ehren
4 years agoMicrosoft Employee
It's unclear to me how Table C was constructed. Can you elaborate on what the logic is?