RELATED vs LOOKUPVALUE – which one to use? (DAX – Power Pivot, Power BI)
There are two functions in DAX with similar, and sometimes replaceable, use. I am talking about RELATED and LOOKUPVALUE.
Both can be used to assign values from other table - similarly to VLOOKUP in Excel.
So, if they are similar, which one should be used in which situation?
Why to use RELATED
- It is simple - only use one parameter.
- It can work through multiple tables, if they are connected by the "one to many" relation.
Why to use LOOKUPVALUE
- Tables don´t need any relation - so it can be used when the relation can´t be created.
- LOOKUPVALUE can use multiple keys at the same time. So, for example, you can use not only a surname, but first name and surname together.
- LOOKUPVALUE doesn´t need the other table - it can take values from the table where LOOKUPVALUE formula takes place. Typically, it takes values from other rows, using some key.