0
0
Power BIbi_tool~20 mins

RELATED for cross-table values in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
RELATED Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Calculate Total Sales Using RELATED

You have two tables: Sales with columns OrderID, ProductID, and Quantity, and Products with columns ProductID and Price. You want to create a calculated column in Sales that shows the total sales amount per order line by multiplying Quantity by the Price from Products.

Which DAX formula correctly uses RELATED to get the Price from the Products table?

ATotal Sales = Sales[Quantity] * RELATED(Products[Price])
BTotal Sales = Sales[Quantity] * RELATED(Sales[Price])
CTotal Sales = RELATED(Sales[Quantity]) * Products[Price]
DTotal Sales = Sales[Quantity] * LOOKUPVALUE(Products[Price], Products[ProductID], Sales[ProductID])
Attempts:
2 left
💡 Hint

Remember, RELATED fetches a value from a related table using an existing relationship.

visualization
intermediate
2:00remaining
Visualizing Related Table Data

You have a Customers table and an Orders table related by CustomerID. You want to create a report showing each customer's name and the total number of orders they placed.

Which visualization and measure setup best uses RELATED or related concepts to display this information?

AUse a table visual with Customer Name from <strong>Orders</strong> and a measure: <code>Total Orders = COUNT(Orders[OrderID])</code>
BUse a table visual with Customer Name from <strong>Customers</strong> and a measure: <code>Total Orders = COUNT(Orders[OrderID])</code>
CUse a table visual with Customer Name from <strong>Customers</strong> and a measure: <code>Total Orders = COUNTROWS(RELATEDTABLE(Orders))</code>
DUse a table visual with Customer Name from <strong>Customers</strong> and a calculated column: <code>Order Count = RELATED(Orders[OrderID])</code>
Attempts:
2 left
💡 Hint

Think about how to count related rows from another table.

🧠 Conceptual
advanced
2:00remaining
Understanding RELATED Function Direction

In Power BI, the RELATED function retrieves a value from a related table. Which statement best describes the direction in which RELATED works in a data model?

A<code>RELATED</code> retrieves values from the 'many' side to the 'one' side in a one-to-many relationship.
B<code>RELATED</code> retrieves values only within the same table.
C<code>RELATED</code> retrieves values from the 'one' side to the 'many' side in a one-to-many relationship.
D<code>RELATED</code> retrieves values only between tables with many-to-many relationships.
Attempts:
2 left
💡 Hint

Think about which table has the unique key and which has multiple rows.

🔧 Formula Fix
advanced
2:00remaining
Identify the Error Using RELATED

You wrote this calculated column formula in the Orders table:

Customer City = RELATED(Customers[City])

But you get an error: "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

What is the most likely cause of this error?

AThe <code>Customers[City]</code> column is a calculated table, not a column.
BThe <code>Customers[City]</code> column contains multiple values per customer.
CThe <code>RELATED</code> function is used on the 'one' side instead of the 'many' side.
DThere is no relationship between <strong>Orders</strong> and <strong>Customers</strong> tables.
Attempts:
2 left
💡 Hint

Check if the tables are connected properly.

🎯 Scenario
expert
3:00remaining
Complex Measure Using RELATED in a Many-to-One Scenario

You have three tables: Sales (with OrderID, ProductID, Quantity), Products (with ProductID, CategoryID, Price), and Categories (with CategoryID, CategoryName). Relationships are Sales → Products (many-to-one) and Products → Categories (many-to-one).

You want to create a measure that calculates the total sales amount for a selected category by multiplying Quantity by Price and filtering by CategoryName.

Which DAX measure correctly uses RELATED to achieve this?

ATotal Sales by Category = CALCULATE(SUMX(Sales, Sales[Quantity] * RELATED(Products[Price])), FILTER(Products, RELATED(Categories[CategoryName]) = SELECTEDVALUE(Categories[CategoryName])))
BTotal Sales by Category = CALCULATE(SUMX(Sales, Sales[Quantity] * RELATED(Products[Price])), FILTER(Products, Categories[CategoryName] = SELECTEDVALUE(Categories[CategoryName])))
CTotal Sales by Category = CALCULATE(SUMX(Sales, Sales[Quantity] * RELATED(Products[Price])), FILTER(Sales, RELATED(Products[CategoryID]) = RELATED(Categories[CategoryID]) && RELATED(Categories[CategoryName]) = SELECTEDVALUE(Categories[CategoryName])))
DTotal Sales by Category = CALCULATE(SUMX(Sales, Sales[Quantity] * RELATED(Products[Price])), Products[CategoryID] = RELATED(Categories[CategoryID]) && Categories[CategoryName] = SELECTEDVALUE(Categories[CategoryName]))
Attempts:
2 left
💡 Hint

Remember that RELATED works from many-to-one, and filtering should be done on the correct table.