#This issue needs to be solved in Power Query#
I have a power query table, "INVENTORY" with a list of inventory (One row for each item I have in inventory, i.e. duplicate values). I have a second table, "COMMITTED INVENTORY" which lists the SKUs of inventory that has been committed to a client and is not available to be sold. (Also one row for each item I have in inventory, i.e. duplicates)
I need to adjust my PQ inventory query to filter out the SKUs in the Committed Inventory table.
Properties of the INVENTORY table:
Every product in inventory is a single row. So if I have a quantity of 6 of one SKU, it is repeated 6 times.
Each duplicate SKU could have a different cost.
Fields in Inventory: SKU | DESCRIPTION | COST | PRICE
Properties of the COMMITTED INVENTORY table
This table has one column, "SKU"
This table could have duplicates
Fields in Committed Inventory: SKU
Both tables are Power Query Tables
Logic
Each SKU in needs to be processed 1 by 1 (I think??)
If SKU#1 in "Committed Inventory" table exists in inventory, remove the row with the lowest "cost" field.
Move to next...
For some reason I could not attach a file or an image or a link to the post. Not sure what's goin on there. If anyone can help, I'll figure out a way to get the sample data to you. I tried to explain the scenario as best as I can.
Here is basically a CSV of sample data since I can't attach a file
INVENTORY TABLE
SKU,Description,Cost,Price
SKU10001, "Product 1",50.00,80.00
SKU10001, "Product 1",45.00,80.00
SKU10001, "Product 1",50.00,80.00
SKU10001, "Product 1",50.00,80.00
SKU10001, "Product 1",30.00,80.00
SKU10001, "Product 1",50.00,80.00
SKU10001, "Product 1",45.00,80.00
SKU10002, "Product 2",125.00,150.00
SKU10003, "Product 3",100.00,175.00
SKU10004, "Product 4",57.00,90.00
SKU10005, "Product 5",64.00,110.00
SKU10006, "Product 6",129.00,200.00
SKU10006, "Product 6",139.00,200.00
SKU10006, "Product 6",129.00,200.00
SKU10006, "Product 6",129.00,200.00
SKU10007, "Product 7",55.00,85.00
SKU10008, "Product 8",75.00,115.00
COMMITTED INVENTORY TABLE
SKU
SKU10001
SKU10001
SKU10001
SKU10006
SKU10006
SKU10007
DESIRED FILTERED INVENTORY
SKU,Description,Cost,Price
SKU10001, "Product 1",50.00,80.00
SKU10001, "Product 1",50.00,80.00
SKU10001, "Product 1",50.00,80.00
SKU10001, "Product 1",50.00,80.00
SKU10002, "Product 2",125.00,150.00
SKU10003, "Product 3",100.00,175.00
SKU10004, "Product 4",57.00,90.00
SKU10005, "Product 5",64.00,110.00
SKU10006, "Product 6",129.00,200.00
SKU10006, "Product 6",139.00,200.00
SKU10008, "Product 8",75.00,115.00
Bookmarks