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>)
ArgumentRequiredDescription
columnRequiredThe 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]))
ProductManufacturing Cost
Amarilla40,381,900
Carretera440,538
Montana770,990
Paseo3,382,395
Velo19,490,940
VTT42,195,750
Total106,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