Downloads
DAXRelationships and lookupBeginner

RELATED

Brings a value from the one side of a relationship into the current row of the many side.

Syntax
RELATED(<column>)

Returns: A single value from the related row.

What it does

RELATED follows an existing relationship from the many side (the fact table, such as Sales) to the one side (a dimension, such as Product), and returns one column value. Use it in a calculated column on Sales to add the product category to each line. Use it inside an iterator over Sales to pull a product attribute such as unit cost. A relationship must already exist.

Syntax and arguments

Example

Add the product category to each sales line, as a calculated column on Sales.

Product Category =
RELATED ( Product[ProductCategory] )

Each row in Sales gets the category of its product, found through the product key. Because it is a calculated column, the value is stored when the model refreshes, and the column can then be used for slicing and grouping.

Example: a second use

A standard cost for the quantity sold, using each product's unit cost instead of the cost recorded on each line.

Standard Cost =
SUMX (
    Sales,
    Sales[SalesQuantity] * RELATED ( Product[UnitCost] )
)

For each sales line, the quantity is multiplied by the product's unit cost from the Product table. The total is the cost at list unit cost, which can differ from the TotalCost recorded on each line. A difference like that is a useful review point.

Things to watch

In business terms

Adding product category, store country or customer segment to transaction lines so reports can group by them. It is also used to bring a standard cost, tax rate or account classification into a ledger detail table.

Related functions

All DAX functions · View as Markdown · DAX fundamentals