Power BI Lookup/VLOOKUP

Power BI Lookupvalue Excel Data
Contents

    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.

    Power BI Lookupvalue Excel Data
    Power BI Lookup/VLOOKUP 20

    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.

    LOOKUPVALUE Syntax 1
    Power BI Lookup/VLOOKUP 21

    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.

    Power BI LOOKUPVALUE.png
    Power BI Lookup/VLOOKUP 22

    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.

    Power BI Lookupvalue Tables
    Power BI Lookup/VLOOKUP 23

    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”.

    Power BI Lookupvalue New column
    Power BI Lookup/VLOOKUP 24

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

    Power BI Lookupvalue Discount
    Power BI Lookup/VLOOKUP 25

    4. now open the LOOKUPVALUE function.

    Power BI Lookupvalue lookupvalue function
    Power BI Lookup/VLOOKUP 26

    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”.

    Power BI Lookupvalue Discount Table
    Power BI Lookup/VLOOKUP 27

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

    Power BI Lookupvalue Product table
    Power BI Lookup/VLOOKUP 28

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

    Power BI Lookupvalue Product
    Power BI Lookup/VLOOKUP 29

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

    Power BI lookupvalue discount result 1
    Power BI Lookup/VLOOKUP 30

    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.

    Power BI Lookupvalue Format percent
    Power BI Lookup/VLOOKUP 31

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

    Power BI Lookupvalue Format percent 1
    Power BI Lookup/VLOOKUP 32

    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.

    Power BI Lookupvalue Tax lookupvalue
    Power BI Lookup/VLOOKUP 33

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

    Power BI Lookupvalue Tax table
    Power BI Lookup/VLOOKUP 34

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

    Power BI Lookupvalue Tax Product
    Power BI Lookup/VLOOKUP 35

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

    Power BI Lookupvalue Tax Product 1
    Power BI Lookup/VLOOKUP 36

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

    Power BI Lookupvalue Tax
    Power BI Lookup/VLOOKUP 37

    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)

    Updated on 28. March 2024
    Was this article helpful?

    Leave a Reply

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