Forum Discussion
Adding column based on value from other table
- 4 years ago
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] ) )
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] )
)- Anonymous4 years agoNot applicable
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?
- AlexisOlson4 years ago
Super User
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 )- Anonymous4 years agoNot applicable
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.