Forum Discussion
Rogerh
Helper II
6 years agoLookup another table with Multiple Values, if one value is correct report back
Good morning all, I need some help please! I have two tables, Orders and Product Builder; The order table has a single line for each order. The Product table is the order broken down by each line...
- 6 years ago
Hi Rogerh ,
I think you missed my last response. Try using following dax:
Try something like this:Delivery Charge = Var lookup = CALCULATE(FIRSTNONBLANK('Platform - Pro Builder'[supplier_id], 1), FILTER(ALL('Platform - Pro Builder')'Platform - Pro Builder'[order_id] = 'Platform - Orders'[order_id]))Var checkVal = 987RETURNIF( lookup = checkVal, "YES", "NO")Thanks,Pragati
Pragati11
Super User
6 years agoHi Rogerh ,
Try modifying the dax as follows:
Delivery Charge = Var lookup = LOOKUPVALUE('Platform - Pro Builder'[supplier_id], 'Platform - Pro Builder'[order_id], 'Platform - Orders'[order_id])
Var checkVal = 987
RETURN
IF( lookup = checkVal, "YES", "NO")
This should resolve the issue.
Thanks,
Pragati
Rogerh
Helper II
6 years agoHi Pragati11
Thanks again but i am getting the same error - A Table of Multiple Values was supplierd where a single value was exspected.
I think this is due to the Pro Builder Table having the Order_ID multipul times. Is there another way around you can think of please? Cheers
- Pragati116 years ago
Super User
Hi Rogerh ,
Try something like this:Delivery Charge = Var lookup = CALCULATE(FIRSTNONBLANK('Platform - Pro Builder'[supplier_id], 1), FILTER(ALL('Platform - Pro Builder')'Platform - Pro Builder'[order_id] = 'Platform - Orders'[order_id]))Var checkVal = 987RETURNIF( lookup = checkVal, "YES", "NO")Thanks,Pragati- Rogerh6 years ago
Helper II
Hi Pragati11
Thank you! Will this work?
Platform - Orders Column We are working on Order_ID Delivery Charge 123 Yes 124 Yes 125 No Platform - Pro Builder Pro_Builder_ID Order_ID Supplier_ID 455 123 987 454 123 974 453 123 985 452 124 987 451 124 987 450 124 954 449 125 974 448 125 985 - Pragati116 years ago
Super User
Hi Rogerh ,
I think you missed my last response. Try using following dax:
Try something like this:Delivery Charge = Var lookup = CALCULATE(FIRSTNONBLANK('Platform - Pro Builder'[supplier_id], 1), FILTER(ALL('Platform - Pro Builder')'Platform - Pro Builder'[order_id] = 'Platform - Orders'[order_id]))Var checkVal = 987RETURNIF( lookup = checkVal, "YES", "NO")Thanks,Pragati