Returns a related value from another table.
1. Function Overview
Definition
RELATED() retrieves a value from a related table by following an existing relationship between two tables (usually a many-to-one relationship).
It works similarly to a VLOOKUP or JOIN operation in Excel/SQL — it fetches data from another table where a relationship exists in the model.
2. Syntax
RELATED(<columnName>)Parameter
Parameter | Description |
columnName | The column that contains the related value you want to retrieve. |
3. Return Value
Returns a single value from the related table that corresponds to the current row context in the table where it is used.
4. Requirements
✅ There must be an existing relationship between the two tables.
✅ The relationship should ideally be many-to-one (the current table → related lookup table).
✅ You use RELATED() from the many-side of the relationship to fetch data from the one-side.
5. Example Scenario (CONTOSO Example)
Tables
- Sales Table:
Sales[ProductKey],Sales[Quantity],Sales[TotalSales] - Products Table:
Products[ProductKey],Products[ProductName],Products[Category]
Relationship
Sales[ProductKey] → Products[ProductKey] (Many-to-One)
Example Formula
= RELATED(Products[Category])Explanation:
For each row in the Sales table, DAX looks up the related Category from the Products table using the existing relationship.
6. Use Cases
Use Case | Description | Example |
1. Retrieve related lookup values | Fetch attributes from a dimension table (like product, region, or customer). | RELATED(Customer[Country]) |
2. Create calculated columns | Add descriptive data to a fact table for analysis. | RELATED(Product[Category]) |
3. Combine data across tables | Enrich data models before creating measures. | RELATED(Region[RegionName]) |
7. Example in Practice
Example 1 — Adding a Related Column
If you want to add Product Category to the Sales table:
Product Category = RELATED(Product[Category])
This creates a new column in Sales that shows the corresponding category for each product.
Example 2 — Combining in a Measure
You can use RELATED() inside measures, such as:
Total Sales by Category =
SUMX(
Sales,
Sales[Quantity] * RELATED(Product[UnitPrice])
)
Here, RELATED(Product[UnitPrice]) brings the unit price from the Product table to the Sales table for multiplication with quantity.
8. Direction of Relationship
Direction | Can use RELATED? | Explanation |
From Many → One | ✅ Yes | Common usage (e.g., Sales → Product) |
From One → Many | ❌ No | Use RELATEDTABLE() instead |
If you need to go from the one-side to many-side, use:
RELATEDTABLE(<tableName>)
9. Common Errors and Fixes
Error | Cause | Fix |
“The column does not exist or cannot be found in the current context.” | You typed the wrong table or column name. | Check spelling and ensure relationships exist. |
“The column cannot be found because there is no relationship.” | No relationship between tables. | Create a relationship in the model. |
Unexpected multiple values | Relationship direction or cardinality issue. | Ensure it’s many-to-one or one-to-one. |
10. Comparison with RELATEDTABLE
Function | Direction | Returns | Example |
RELATED() | Many → One | Single value | RELATED(Product[Category]) |
RELATEDTABLE() | One → Many | Table | RELATEDTABLE(Sales) |
11. Performance Tips
- Use only when necessary in calculated columns.
- Avoid using it in measures if the relationship already propagates filters.
- Combine with
SUMX,AVERAGEX, etc., for efficient row-by-row calculations.
12. Practical Finance Example
Tables:
Transactions:CustomerID,AmountCustomers:CustomerID,Region
Formula:
Region = RELATED(Customers[Region])
Usage:
This allows analysts to see total spending by region even though the region exists only in the Customers table.
13. Summary
Key Point | Description |
Function Type | Relationship/Lookup Function |
Direction | From Many to One |
Output | Single related value |
Similar to | Excel’s VLOOKUP or SQL JOIN |
Opposite Function | RELATEDTABLE() |
14. Quick Recap with Analogy
Concept | Excel Equivalent | SQL Equivalent |
RELATED() | VLOOKUP | INNER JOIN (Many → One) |
RELATEDTABLE() | FILTER | JOIN returning multiple rows |
✅ In Summary:
RELATED() is a powerful DAX function that lets you bring descriptive or categorical data from a related lookup table into your fact table. It’s most commonly used in calculated columns or within iterating functions like SUMX() to perform row-level operations based on relationships