illusionek
Board Regular
- Joined
- Jun 21, 2014
- Messages
- 104
Hi Guys
Please could you help me to develop this solution in the Power Query. I believe I understand steps I need to go through or at least this is how I would do it in MS Access but not sure how to do it in PQ as I am really new to this. I especially struggle with Steps 4, 5, 6
1 Bring all tables into the data model
2 Group by Product/Item No & Colour to get total quantity for each as there may be duplicates in each column
3 Append both tables for Product/Item No and Colour
4 ‘Select Distinct’ from appended table to get unique list of Product/Item Nos and Colours
5 Create new table with the list from Step 4
6 Create a link between table from Step 5 and tables from Step 2. Link is based on the combination of Product/Item No & Colour (ie concatenate)
7 Bring qtys from both columns
8 Create function to deduct one from the other
Table A
<tbody>
</tbody>
Table B
<tbody>
</tbody>
Results
<tbody>
</tbody>
Please could you help me to develop this solution in the Power Query. I believe I understand steps I need to go through or at least this is how I would do it in MS Access but not sure how to do it in PQ as I am really new to this. I especially struggle with Steps 4, 5, 6
1 Bring all tables into the data model
2 Group by Product/Item No & Colour to get total quantity for each as there may be duplicates in each column
3 Append both tables for Product/Item No and Colour
4 ‘Select Distinct’ from appended table to get unique list of Product/Item Nos and Colours
5 Create new table with the list from Step 4
6 Create a link between table from Step 5 and tables from Step 2. Link is based on the combination of Product/Item No & Colour (ie concatenate)
7 Bring qtys from both columns
8 Create function to deduct one from the other
Table A
Item No | Colour | Qty | Supplier |
A123 | Blue | 1 | S123 |
B123 | Pink | 3 | S456 |
A123 | Blue | 4 | S123 |
C123 | White | 3 | S456 |
D123 | Green | 2 | S456 |
D123 | Pink | 1 | S123 |
<tbody>
</tbody>
Table B
Product No | Colour Name | Quantity | Customer |
A123 | Blue | 3 | ABC |
B123 | Black | 4 | CDE |
A123 | Blue | 5 | FEG |
C123 | White | 2 | ABC |
D123 | Green | 3 | FEG |
D123 | Grey | 1 | CDE |
<tbody>
</tbody>
Results
Product No | Colour Name | Table A | Table B | Variance |
A123 | Blue | 5 | 8 | -3 |
B123 | Black | 0 | 4 | -4 |
B123 | Pink | 3 | 0 | 3 |
C123 | White | 3 | 2 | 1 |
D123 | Green | 2 | 3 | -1 |
D123 | Grey | 0 | 1 | -1 |
D123 | Pink | 1 | 0 | 1 |
<tbody>
</tbody>