Related() and RelatedTable()

RELATED() is one of the most-used DAX functions. You use RELATED() when you’re iterating a table and, within that row context, you need a value from a related table. Its companion, RELATEDTABLE(), goes the opposite way across the relationship. It’s easy to mix these up using RELATED() when it isn’t needed, or forgetting about RELATEDTABLE(). In this article, we’ll cover the typical use cases for both and clear up common misconceptions.

Demo data: Customers (dimension) and Sales (fact), linked on CustomerID.
Diagram illustrating the relationship between Customers and Sales tables in Power BI, highlighting a one-to-many relationship using DAX functions RELATED() and RELATEDTABLE().

CustomerCountry = RELATED(Customers[Country])
Excel table showing calculated column 'CustomerCountry' using RELATED function to display countries for sales, with columns for SaleID, CustomerID, Product, Quantity, Amount, and CustomerCountry.

TotalSales = COUNTROWS(RELATEDTABLE(Sales))
Table displaying CustomerID, CustomerName, Country, and TotalSales values calculated using RELATEDTABLE function in Power BI.
 TotalSalesAmount = SUMX(RELATEDTABLE(Sales), Sales[Amount])
An Excel table displaying customer sales data with columns for CustomerID, CustomerName, Country, and TotalSalesAmount. The TotalSalesAmount column shows the sales figures for three customers: Alice from the USA, Bob from the UK, and Charlie from Canada.

Comparison of DAX functions RELATED() and RELATEDTABLE() in Power BI, displaying TotalSalesAmount for each customer and associated sales details.

Similar Posts