RELATEDTABLE

The RELATEDTABLE function returns the subset of a remote table related to the row being considered in the table in which we are working (current table), assuming that there is a relationship between the current table and the remote one, regardless of the type of relationship.

In other words, this function allows, for example, from a dimension table, to extract the associated records from a fact table in the form of a table.

Syntax

RELATEDTABLE(
    table
)

Parameters
  • table: Name of the remote table. It cannot be an expression.
Returned value

The RELATEDTABLE function returns a table.

Additional Information

This function is a quick way to run the CALCULATETABLE function when no filters are specified.

Examples

If we have a fact table containing sales (Sales table) in which the amount of each sale is registered in the SalesAmount field and we want to add the total sales by category to the Category dimension table, we can define the following calculated column:

Category sales = SUMX(RELATEDTABLE(Sales), Sales[SalesAmount])

This expression accesses the remote table (the fact table), extracts the subset of this table associated with each of the categories and adds the SalesAmount field for each of them:

RELATEDTABLE function. Example of use
Related functions
Category
Filter
Submitted by admin on Thu, 01/03/2019 - 15:30