Power BI: VLOOKUP Introduction
What is VLOOKUP?
VLOOKUP (Vertical Lookup) is an Excel function used to search for a value in the first column of a
range or table and return a value in the same row from another column. Power BI doesn't have
a direct VLOOKUP function, but similar functionality can be achieved using:
DAX (Data Analysis Expressions): with RELATED, LOOKUPVALUE, or MERGE Queries in
Power Query.
How to Use VLOOKUP in Power BI
✅ Method 1: Using LOOKUPVALUE in DAX
LOOKUPVALUE(Result_ColumnName, Search_ColumnName, Search_Value)
Prepare the Data in Excel
Employee Table
Dept Table
Dept_ID is common Field in both table
Now Find the Employee Department name using lookup function in DAX
How Lookup function work see the diagram
Load data into dashboard
Create new Column in Employee table
Click on Execute button
1 Department ID is for Sales so that all department becomes Sales
Change the value in Vlookup function
But here department id 8 and 9 has not department because the dept_id has no information in
dept table see it
So Assign the default value to these department
Change the vlookup function again
Match Multiple Values
Result will be same because deptcode match both side
Example Scenario:
You have two tables:
Sales (with ProductID, Quantity)
Products (with ProductID, ProductName, Price)
You want to add ProductName to the Sales table.
Step-by-step:
1. Go to Model View.
2. Create a relationship between Sales[ProductID] and Products[ProductID].
3. Use this DAX in a new calculated column in the Sales table:
ProductName = LOOKUPVALUE(Products[ProductName], Products[ProductID], Sales[ProductID])
✅ Method 2: Using Power Query (Merge Queries)
1. Go to Home > Transform Data.
2. In Power Query, click Merge Queries.
3. Select the Sales and Products tables.
4. Match both tables using ProductID.
5. Choose to expand the ProductName and/or Price column(s).
Practical Example
🎯 Tables:
Products Table
ProductID ProductName Price
101 Pizza 250
102 Burger 120
103 Pasta 180
Sales Table
SaleI ProductI Quantity
D D
1 101 2
2 103 1
3 102 3
🎓 Goal:
Add ProductName and Price to the Sales table using VLOOKUP-like behavior.
✅ Using DAX
ProductName = LOOKUPVALUE(Products[ProductName], Products[ProductID], Sales[ProductID])
Price = LOOKUPVALUE(Products[Price], Products[ProductID], Sales[ProductID])
✅ Using Power Query Merge:
1. Merge Sales with Products on ProductID.
2. Expand ProductName and Price.
3. Final Sales Table:
SaleI ProductI Quantity ProductNam Price
D D e
1 101 2 Pizza 250
2 103 1 Pasta 180
3 102 3 Burger 120
Summary
Feature Excel VLOOKUP Power BI Equivalent
Lookup Function VLOOKUP() LOOKUPVALUE() or Merge Query
Based on Relationships ❌ ✅ Using data model
Multiple Values Return ❌ ✅ (in Power Query)
Flexibility Less More with DAX/Power Query