Alberto Ferrari explains how the LOOKUPVALUE works:
LOOKUPVALUE requires a column to retrieve a set of column/value pairs to provide the search conditions, and an optional default value in case there are either no matching rows, or too many matching rows. The following formula retrieves the exchange rate from the Daily Exchange Rate table, where Currency[Currency Code] matches EUR and ‘Daily Exchange Rate'[Date] matches Sales[Order Date]. In case there are no matches, it returns zero:
Alberto also provides a primer on the function in case you are unfamiliar with it, as this post starts with the assumption that you know what it does.