Menu
CoddyTech

Looking Up with RELATED

Part of the Power BI Basics section of Coddy's Power BI journey. Lesson 24 of 28.

A Sales column cannot read Products[UnitCost] directly: which product?

RELATED follows the relationship to the matching row and brings back its value.

Cost = Sales[Quantity] * RELATED(Products[UnitCost])

It works from Sales towards a lookup table, which has one row per key.

challenge icon

Challenge

Easy

Add a column Cost to Sales: the quantity times the unit cost of the product, looked up in Products.

Try it yourself

Cost =
DateQuantityCost
2024-01-123
2024-01-202
2024-01-244
Fields
  • Sales
    • OrderID
    • Date
    • StoreID
    • ProductID
    • CustomerID
    • Quantity
    • UnitPrice
    • Amount
  • Products
  • Stores
  • Customers
  • Dates
  • Targets

All lessons in Power BI Basics