Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I am attempting to essentially do a VLOOKUP in Power BI. I am trying to create a column that adds a supplier's name. The tables that I am using for this do not have the information required in the current tables. I have tried to connect other tables as well, but nothing seems to give the results I need.
I essentially need a column up top that has the supplier name. I was thinking if there is a way to match the p21_view_invoice_line[supplier_id] to the p21_item_view[supplier_id] column, then maybe there is a way to return the p21_item_view[supplier_name] column to the associated supplier_id.
This may be an easy fix, I am new to Power BI, so any other tips or tricks are welcomed too.
Solved! Go to Solution.
What I suggested should work for calculated columns but with a measure, it doesn't automatically know which id value you want to look up (since there isn't the same row context that exists for a calculated column).
Try adding an aggregation as the error message indicates:
LOOKUPVALUE (
item[supplier_name],
item[supplier_id], SELECTEDVALUE ( invoice[supplier_id] )
)
The LOOKUPVALUE function works pretty similarly to VLOOKUP.
Try something along these lines:
LOOKUPVALUE (
item[supplier_name],
item[supplier_id], invoice[supplier_id]
)
When I atempt to use that function, I am getting this error. Do you know what could be causing this?
What I suggested should work for calculated columns but with a measure, it doesn't automatically know which id value you want to look up (since there isn't the same row context that exists for a calculated column).
Try adding an aggregation as the error message indicates:
LOOKUPVALUE (
item[supplier_name],
item[supplier_id], SELECTEDVALUE ( invoice[supplier_id] )
)
Can I use this formula but add a true and false / IF THEN statement. Basically sating if this column equals "0" then pull the data from another column. If it is possible, how would it look?
I don't know what columns you're referencing, so you'll need to fill in the blanks.
VAR Result1 = LOOKUPVALUE ( [...] )
VAR Result2 = [...]
VAR ThisCol = SELECTEDVALUE ( [...] )
RETURN
IF ( ThisCol = 0, Result2, Result1 )
Here is the formula I am trying to use. Basically what I am attempting is to pull a rebate cost from the other_cost culumn, but if the cost is $0 (non rebate) I want it to pull from the cogs_amount. I beleive this is a simple formula, I just cannot figure it out.
Sorry. I'm sure it is a simple adjustment but I just can't tell how things are related well enough to help since you're talking about different columns I don't have any context for.
Example input and expected output would help greatly.
The error message I am getting is that too few arguments were passed through the lookupvalue function. Ignore the error message from the picture above, I just accidently deleted the () around the Result2 argument.