Power query vlookup multiple return

denmla

New Member
Joined
Dec 30, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi,

I would need some help with the example below.

I joined two tables in a power query, their link is the "Artikl"column.
What I need to get, for every line in column "Artikl" data from column "Pozicija" as needed according to the criteria.

Criterion: if the column "Nadopuna" is greater than the column "Stanje" let me show all items from the column "Pozicije" that have a total quantity greater than the value in the column replenishment.

It must first provide the items with the smallest amount in the "Stanje" column.

Thanks in advance!


Case.png
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
It looks like you're almost there, but need to concatenate the resulting list, like this?
Power Query:
let
    Source = {"A".."Z"},
    Custom1 = Lines.ToText( Source, ", " ),
    Custom2 = Text.Length( Custom1 ),
    Custom3 = Text.Range( Custom1, 0, Custom2-2 )
in
    Custom3
The Source List of the letters A through Z is converted to:
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z
by the Lines.ToText function, and the trailing comma and space are trimmed off with Text.Range using the value found with Text.Length.
I find having the Power Query M formula language PDF handy is helpful in finding functions I need.
That link is at the bottom left hand corner of the Power Query M formula language page, and updated regularly.
 
Upvote 0
or you could use

Power Query:
Text.Combine({"A".."Z"}, ", ")

it won't add a delimiter after the final text (in this case "Z")
 
Upvote 0
I can't figure out how to do this.
I have put a table with the result as I would like it to look
1672601546490.png
 
Upvote 0
... let me show all items from the column "Pozicije" that have a total quantity greater than the value in the column replenishment.
Let's clarify this line first: what column are you calling "Replenishment"? Total quantity of items in Pozicije?
You don't always have to expand columns after merge, you can also aggregate. This looks like a task for aggregation.
 
Upvote 0
To make it a little clearer what I'm trying to do, I'll explain what it's all about.
These are tables that show the quantity of the item (SKU) by warehouse position.
One table shows how many SKU (Artikl) are in one part of the warehouse and how much is needed
to be added so that the item can completely leave the warehouse.
Picking = qty in first part of warehose
Nadopuna = replenishment - total qty witch we need replenish to first part of warehouse
Stanje = qty per location
Pozicija = location witch we need take article
This is example for only one SKU from table
1672684163396.png

Total quantity of items in Pozicije?
We need replenish 4 pce :
1 from position 414CESSKL0535B03
2 from position 414CESSKL0538E01
and 1 from 414CESSKL0507D02 = 4 PCE, but I want take all pallet from 414CESSKL0507D02 12 PCS because it is faster.
 

Attachments

  • Case.png
    Case.png
    66.6 KB · Views: 7
Upvote 0
If that's the case, while in Power Query, add a conditional column and in the dialog box:
if Nadopuna is greater than Stanje then Pozicija_list

The Picking column doesn't seem to play a part in what you are trying to pull from the table. The new conditional column above will produce a list of items from Pozicija that satisfy "Nadopuna > Stanje". If this seems like what you've been looking for, the next step would be the easiest- sort ascending of column "Stanje".
 
Upvote 0

Forum statistics

Threads
1,223,391
Messages
6,171,820
Members
452,426
Latest member
cmachael

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top