Forum Discussion
Looking up values based on two variables
- Anonymous4 years ago
Hi Anonymous ,
Please refer to my pbix file to see if it helps you.
Create a column.
Column = VAR datelive = LOOKUPVALUE ( Refference[DateLive], Refference[SKU], Transactions[SKU] ) RETURN IF ( Transactions[PurchaseDate] >= datelive, "Live", "Not live" )If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years ago
This will work. Thank you so much
If your Reference table only contains unique values, i.e. 1 row per SKU, then you can create a 1-to-many relationship between the tables and use the RELATED function to add a calculated column to the Transactions table, e.g.
Was live = IF( Transactions[Purchase Date] > RELATED('Reference'[Date Live]), "Yes", "No")Is there any other way without doing relationship between these two tables?
- johnt754 years agoSuper User
You could use LOOKUPVALUE but that will fail if it returns more than 1 value, so you really need the SKUs to be unique