XLOOKUP in Power Pivot: Step-by-Step Guide
In this article
Power Pivot doesn't have an XLOOKUP function, but you can achieve the same result—looking up a value from another table—using RELATED in a calculated column or LOOKUPVALUE in a measure. This guide shows you both methods, step by step, so you can bring related data into your data model just like you would with XLOOKUP in Excel.
What You'll Need
- Power Pivot enabled in Excel (File > Options > Add-ins > COM Add-ins > Microsoft Power Pivot for Excel).
- Two tables in the Power Pivot data model that share at least one common column (e.g., Product ID).
- Both tables must be loaded into Power Pivot (via Power Query, Excel tables, or direct import).
Step-by-Step
Method 1: Using RELATED in a Calculated Column (Best for one-to-many relationships)
- Open your workbook and go to the Power Pivot tab, then click Manage.
- In the Power Pivot window, click Diagram View (on the Home tab) to see your tables.
- Create a relationship between the two tables: drag the common column from one table to the other. For example, drag ProductID from the Sales table to ProductID in the Products table. This is the equivalent of the lookup range in XLOOKUP.
- Go back to Data View (Home tab > Data View).
- Select the table where you want the lookup result to appear (e.g., the Sales table).
- Click the Add Column button on the Design tab, or click in the first empty column header.
- In the formula bar, type:
=RELATED(Products[ProductName])— replace Products with the name of the lookup table and ProductName with the column you want to return. - Press Enter. The column fills with the matching values from the lookup table, just like XLOOKUP.
Method 2: Using LOOKUPVALUE in a Measure (Works without a relationship)
- In Power Pivot, go to the table where you want the measure (e.g., Sales).
- Click Measure on the Home tab, then New Measure.
- In the Measure Name box, type something like Product Name Lookup.
- In the Formula box, type:
=LOOKUPVALUE(Products[ProductName], Products[ProductID], Sales[ProductID]) - Click OK. The measure now returns the product name for the current row context when used in a pivot table.
Both methods work like XLOOKUP: they find a match in the lookup table and return a value from a different column. Choose RELATED if you have a relationship and want a static column; choose LOOKUPVALUE for ad-hoc lookups in measures.
Common Mistakes
- Using RELATED without first creating a relationship—you'll get an error.
- Creating a relationship on columns with duplicates (e.g., both sides have repeated IDs). RELATED requires a one-to-many relationship, where the lookup table has unique values.
- Using LOOKUPVALUE when multiple matches exist—it returns an error if more than one match is found.
- Forgetting to refresh the data after adding new rows—the calculated column won't update automatically.
Tips
- Use RELATED for most cases—it's faster and simpler than LOOKUPVALUE.
- Name your calculated columns clearly (e.g., "Product Name") so they appear naturally in pivot tables.
- If you need to return multiple columns, create separate calculated columns with RELATED for each.
- For fuzzy matches (like XLOOKUP with match_mode -1), Power Pivot doesn't support that—you'd need to use Power Query to pre-process the data.
Troubleshooting
- Error: "The column that contains the lookup value is not related to the table" — This means the relationship is missing or incorrect. Go to Diagram View and check that the relationship exists and points from the lookup table to the data table.
- Blank values in the new column — This means no match was found. Check for mismatched data types (e.g., text vs. number) or extra spaces. Use Power Query to clean the key columns.
- Error: "The value for column X in table Y is not unique" — This happens with LOOKUPVALUE when the lookup column has duplicates. Use RELATED instead, or ensure the lookup table has unique keys.
- Column doesn't update when data changes — Calculated columns are static until you refresh the data. Go to Home > Refresh in Power Pivot.
- Can't find Power Pivot tab — It may not be enabled. Go to File > Options > Add-ins, select COM Add-ins, check Microsoft Power Pivot for Excel, and restart Excel.
Frequently Asked Questions
Can I use XLOOKUP directly in Power Pivot?
No, Power Pivot doesn't have XLOOKUP. Use RELATED or LOOKUPVALUE instead.
What's the difference between RELATED and LOOKUPVALUE?
RELATED requires a relationship and works in calculated columns. LOOKUPVALUE works without a relationship and can be used in measures, but requires unique matches.
Can I do a two-column lookup (like XLOOKUP with multiple criteria)?
Yes, use LOOKUPVALUE with multiple lookup columns: =LOOKUPVALUE(Table[ReturnCol], Table[Col1], Value1, Table[Col2], Value2).
Why is my RELATED column returning blanks?
Usually because the key columns don't match exactly—check for text vs. number formatting or trailing spaces. Also ensure the relationship is active (solid line in Diagram View).
Can I use these functions in DAX measures for a pivot table?
Yes, LOOKUPVALUE works in measures. RELATED also works in measures if the row context is from the related table.
Is there a way to do a fuzzy match or approximate lookup?
No, Power Pivot only supports exact matches. For approximate matches, use Power Query to join tables with a fuzzy matching option before loading into Power Pivot.