Power BI Lookup/VLOOKUP

SUSTAINABILITY in Power BI

Apart from the importance of VLOOKUP function, we can use the same function in Power BI. This is the most common question of all Power BI beginners, but unfortunately we do not have SVERWEIS Power BI; instead, we have a similar type of function, i.e. the LOOKUPVALUE function in Power BI. We will guide you through this function in this article. If I have to tell you the importance of SAVE in Excel for all Excel users in simple words, “it is just an essential part”. Yes, SVERWEIS is an integral part of all Excel users and household functions in the Excel world.

What does the LOOKUPVALUE function in Power BI do?

The REFERENCE VALUE function is similar to the REFERENCE function in MS Excel, which searches for the required column from one table to another based on the search value. Since we already know enough about SVERWEIS, we won’t go into this function in depth in theory, so let’s take a look at the scenario now.

I have three tables with me. Below are the screenshots.

We have three tables with the names “Product_Table, Tax-Table and Discount_Table”.

In Product_Table we have no information on “Tax %” and “Discount %”, which are available in the other two tables. The common column of all three tables is “Product”, so we have to retrieve the data in “Product_Table”.

Before we use the LOOKUPVALUE function, let’s take a look at the syntax of this function.

Result column name: This is no different from other tables from whose column we need the result. As an example, we need results from the “Tax %” column for “Tax_Table” and results from the “Discount %” column for “Discount_Table”.

Name of the search column: This is no different than in the target table (Tax_Table or Discount_Table), based on the column in which we are looking for the result column. Our search value: This is the column name in the current table (Product_Table), which is identical to the column in the search column name of other tables.

Ultimately, the search column name and search value should be the same for both columns. The name of the search column comes from the result column table, and the search value column comes from the current table in which we are using the LOOKUPVALUE function.

Example of the DAX function LOOKUPVALUE in Power BI

You can download this Power BI LOOKUPVALUE Excel template here – Power BI LOOKUPVALUE Excel template

Above is the data we use to apply the LOOKUPVALUE-Dax function in Power BI. You can download the workbook via the link below and practise with us.

1. upload all three tables to the Power BI file to start the demonstration.

2. for “Product_Table” we have to get the values from the other two tables, so we first get “Discount %” from “Discount_Table”. Right-click on “Product_Table” and select “New column”.

3. give the “New column” the name “Discount %”.

4. now open the LOOKUPVALUE function.

5. the first argument is the name of the result column, as we are looking for the discount percentage from “Discount_Table”. Select the column name “Discount %” from “Discount_Table”.

6. the next argument is the name of search column 1, so this is the column name “Product” from “Discount_Table”.

7. the next argument is the search value, so this will be a “Product” column name from “Product_Table”.

8 Okay, we’re done. Close the bracket and press the Enter key to get the result.

Here we have the result of “Discount %” from “Discount_Table”. But when we look at the result column, it is not in percentage format, so we need to change the number format to percentage format.

9. go to the “Modeling” tab, select “Percent” as the “Format” and keep the decimal place at 2.

10. this applies the format as below to the selected column.

11 Similarly, we now need to insert another column to get “Tax %” from “Tax_Table”. Right-click as usual and select “New column”, give the new column the name “Tax %” and open the LOOKUPVALUE function again.

12. this time the name of the result column comes from “Tax_Table”, i.e. “Tax %”.

13 The name of the search column is the column name “Product” from “Tax_Table”.

14 The next argument is the search value, so the column name “Product” from “Product_Table” is used.

15. close the bracket and press the Enter key to obtain the “Tax %” values.

For example, we can use the Power BI LOOKUPVALUE function to retrieve data from one table to another.

Note: The Power BI LOOKUPVALUE file can also be downloaded via the following link and the final output displayed.

Dieser Beitrag ist auch verfügbar auf: Deutsch (German)

Was this article helpful?

Related Articles

Submit a Comment

Your email address will not be published. Required fields are marked *

Published on - 7. Jan 2022
Modified on - 28. Mar 2024
Views - 33
Likes - 0

Do you need help?

Kontaktiere uns gerne :-)
Contact Support
Skip to content