LOOKUPVALUE DAX Function (Filter)

Retrieves a value from a table.

Syntax

LOOKUPVALUE ( <Result_ColumnName>, <Search_ColumnName>, <Search_Value> [, <Search_ColumnName>, <Search_Value> [, … ] ] )
Parameter Attributes Description
Result_ColumnName

The column that contains the desired value.

Search_ColumnName Repeatable

The column that contains search_value.

Search_Value Repeatable

The value that you want to find in search_column.

Return values

Scalar A single value of any type.

The value of Result_Column at the row where all pairs of Search_Column and Search_Value have a match.

Remarks

If there is no match that satisfies all the search values, a BLANK is returned. In other words, the function will not return a lookup value if only some of the criteria match.

If multiple rows match the search values and in all cases Result_Column values are identical then that value is returned. However, if Result_Column returns different values an error is returned.

The Search_ColumnName can be any column of the expanded table referenced by Result_ColumnName.

Examples

Search the Rate for a given date and currency included in the same table:

LOOKUPVALUE (
    ExchangeRates[Rate],
    ExchangeRates[Date], DATE ( 2018, 4, 15 ),
    ExchangeRates[Currency], "EUR"
)

Search the Rate for a given date and currency code defined in a related table:

LOOKUPVALUE (
    ExchangeRates[AverageRate],
    ExchangeRates[Date], DATE ( 2018, 4, 15 ),
    Currency[Currency Code], "EUR"
)

Related articles

Learn more about LOOKUPVALUE in the following articles:

  • Lookup multiple values in DAX

    This article describes different techniques to retrieve multiple values from a lookup table in DAX, improving code readability and performance. » Read more

  • From SQL to DAX: Joining Tables

    In SQL there are different types of JOIN, available for different purposes. This article shows the equivalent syntaxes supported in DAX and it was updated in May 2018. » Read more

  • USERELATIONSHIP in Calculated Columns

    In a Power Pivot or Tabular model with inactive relationships, one can rely on the USERELATIONSHIP function to apply an inactive relationship to a particular DAX expression. Its usage is simple in a measure, but one might consider alternative syntax in calculated columns, as is explained in this article. » Read more

  • Expanded tables in DAX

    Expanded tables are the core of DAX; understanding how they work is of paramount importance. This article provides a theoretical foundation of what expanded tables are, along with fundamental concepts useful when reading DAX code. » Read more

Last update: Oct 20, 2018   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

MSDN documentation: https://msdn.microsoft.com/en-us/query-bi/dax/lookupvalue-function-dax

DAX Conventions
Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Deprecated

This parameter is deprecated and its use is not recommended.

Contribute

Want to improve the content of LOOKUPVALUE? Did you find any issue? Please, report it us!
All submissions will be evaluated for possible updates of the content.