DAX RELATED Function: Pull Data from Related Tables Like VLOOKUP on Steroids

Pull data from related tables in Excel tutorial showing Power Pivot relationships and DAX RELATED function
Learn how to retrieve data from related tables in Excel using Power Pivot and DAX. This practical tutorial explains how to create table relationships, use the RELATED function, access connected data, and combine information from multiple tables without manually merging datasets. Ideal for Excel users, data analysts, accountants, finance professionals, and anyone who works with data models and needs to build more flexible reports and dashboards.

Table of Contents

Your Sales table holds a ProductID, but not the product name or category. Those details sit in a separate Products table. In a worksheet, you would reach for VLOOKUP and wrestle with ranges and index numbers. Inside the Data Model, there is a cleaner way. RELATED pulls a column straight from a related table, by simply following the relationship you already built.

This guide shows how RELATED works and when to use it. First, it explains what the function fetches. Then it compares RELATED with VLOOKUP and shows real examples. RELATEDTABLE and a full troubleshooting section follow. By the end, you will link tables like a pro.

What RELATED Does

RELATED reaches into another table for a value. It follows an existing relationship to find it. So a sales row can grab its product category. The infographic below shows that trip.

RELATED follows the relationship to fetch a column Sales (many side) OrderID ProductID 1187 P2 has the key, not the detail RELATED follows the link Products (one side) ProductID Category P2 Audio = RELATED(Products[Category])

Notice how little you have to tell it. You name only the column you want. RELATED handles the matching through the relationship. As a result, the detail lands right beside your data.

It Rides the Relationship

RELATED depends entirely on a relationship. The two tables must already be linked by a key. Then RELATED travels from the many side to the one side. Without that link, the function has nowhere to go.

Build the relationship first. Link Sales to Products on ProductID before you start. So RELATED has a path to follow. No relationship means no result.

RELATED Versus VLOOKUP

Both pull a value from another table. Yet the effort involved is worlds apart. VLOOKUP needs a range, an index, and a match flag. RELATED needs only the column name, as below.

RELATED vs VLOOKUP: same goal, far less setup VLOOKUP - needs a lookup range - needs a column index number - needs exact-match flag - breaks if columns move fragile and manual RELATED - just name the column - uses the model relationship - no index, no match flag - survives column changes clean and robust
The same job, two ways: VLOOKUP: =VLOOKUP(B2, Products, 3, FALSE) RELATED (calculated column): = RELATED( Products[Category] ) VLOOKUP breaks if a column moves. RELATED keeps working, because it uses the relationship.

Example 1: Pull a Category Into Sales

Start with the most common use. You want each sale to show its category. A calculated column with RELATED does it cleanly. Then you can slice sales by that category.

Add the category column: Category = (calculated column in Sales) RELATED( Products[Category] ) Every sales row now shows its category. So a slicer or a group by category just works.

Example 2: Line Total With a Related Price

RELATED shines when you combine tables in math. Suppose the unit price lives in Products. You can multiply the sales quantity by that price. Consequently, a full line total appears per row.

Mix local and related columns: Line Total = (calculated column in Sales) Sales[Qty] * RELATED( Products[Unit Price] ) Qty comes from the sales row itself. Meanwhile, the price is fetched from Products.

RELATEDTABLE for the Other Direction

Sometimes you need to travel the other way. RELATEDTABLE moves from the one side to the many. It returns a whole table of matching rows. So you can count or sum them, as below.

RELATED goes many-to-one; RELATEDTABLE goes one-to-many RELATED from the MANY side looks up the ONE side returns a single value e.g. this sale's Category RELATEDTABLE from the ONE side gathers the MANY side returns a table of rows e.g. all sales for a product
Count sales per product: Sales Count = (calculated column in Products) COUNTROWS( RELATEDTABLE( Sales ) ) RELATEDTABLE gathers every sale for that product. Then COUNTROWS turns the table into a number.

Troubleshooting RELATED

All three problems below are the most common. Each has a clear cause and a quick fix.

RELATED returns an error or a blank

This almost always means the relationship is missing. RELATED cannot fetch a value with no link to follow. First, open the Power Pivot Diagram View. Then confirm a line joins Sales to Products on the key. If none exists, drag the key from one table to the other. Also check that the key values actually match on both sides. Once a valid relationship exists, RELATED starts returning values.

I am pulling from the wrong side

RELATED only travels from the many side to the one. So it reads a dimension from a fact table. It cannot pull many rows into a single row. If you need the reverse, use RELATEDTABLE instead. That function returns the related rows as a table. Then wrap it in COUNTROWS or SUMX to summarise. So match the function to the direction you need.

RELATED ignores an inactive relationship

Two tables can share more than one relationship. However, only one of them is active at a time. RELATED always follows the active relationship. So an inactive link is quietly skipped. To use an inactive one, switch to a measure with CALCULATE. Then add USERELATIONSHIP to activate the link you want. After that, the calculation follows the correct path.

Frequently Asked Questions

  • What does the DAX RELATED function do?+
    It pulls a column value from a related table. First, it follows an existing relationship. Then it returns the matching value on that row. So it works like a VLOOKUP through the model.
  • Is RELATED better than VLOOKUP?+
    For the Data Model, RELATED is far cleaner. It needs only the column name, not a range or index. Moreover, it survives when columns move. So it is more robust than a VLOOKUP.
  • What is the difference between RELATED and RELATEDTABLE?+
    RELATED goes from the many side to the one. It returns a single value, like a category. RELATEDTABLE goes the other way and returns rows. So use it with COUNTROWS or SUMX.
  • Why does RELATED return blank?+
    Usually there is no relationship to follow. So check the link in Diagram View first. Also confirm the key values match on both sides. Once the relationship is valid, the value appears.