DAX RELATED function
Returns a value from a related table, for the current row.
RELATED looks up a value across a relationship, like VLOOKUP but using the model: from a sales row, get the product's manufacturing price. It needs a row (a calculated column or an iterator such as SUMX).
Syntax
RELATED(<column>)| Argument | Required | Description |
|---|---|---|
| column | Required | The column to get, in the table on the "one" side of the relationship. |
Returns: A single value from the related row.
Examples
Calculated on the free practice data (table financials), with [Total Sales] = SUM(financials[Sales]) and [Total Profit] = SUM(financials[Profit]).
1. Manufacturing cost by product
Manufacturing Cost = SUMX(financials, financials[Units Sold] * RELATED(Products[Manufacturing Price]))| Product | Manufacturing Cost |
|---|---|
| Amarilla | 40,381,900 |
| Carretera | 440,538 |
| Montana | 770,990 |
| Paseo | 3,382,395 |
| Velo | 19,490,940 |
| VTT | 42,195,750 |
| Total | 106,662,513 |
For each sale, units times that product's manufacturing price from the Products table, then added.
Good to know
- RELATED works from the many side to the one side. The other direction is RELATEDTABLE.
- It needs an active relationship between the two tables.
Related functions
Official reference: RELATED function on Microsoft Learn