0
0
Power BIbi_tool~10 mins

Relationship direction and cross-filtering in Power BI - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Two tables: Products (A1:B4) and Orders (D1:F4). Products has ProductID and ProductName. Orders has OrderID, ProductID (foreign key), and Quantity.

CellValue
A1ProductID
B1ProductName
A2101
B2Chair
A3102
B3Table
A4103
B4Lamp
D1OrderID
E1ProductID
F1Quantity
D25001
E2101
F22
D35002
E3103
F31
D45003
E4102
F44
Formula Trace
CALCULATE(SUM(Orders[Quantity]), Products[ProductName] = "Chair")
Step 1: Products[ProductName] = "Chair"
Step 2: Cross-filter from Products to Orders via ProductID relationship
Step 3: SUM(Orders[Quantity]) on filtered Orders
Step 4: CALCULATE result
Cell Reference Map
Products Table       Orders Table
+----+------------+   +-------+----------+----------+
| A1 | B1         |   | D1    | E1       | F1       |
|----|------------|   |-------|----------|----------|
|101 | Chair      |   |5001   | 101      | 2        |
|102 | Table      |   |5002   | 103      | 1        |
|103 | Lamp       |   |5003   | 102      | 4        |
+----+------------+   +-------+----------+----------+

Relationship: Products[ProductID] --> Orders[ProductID]
Filter direction: Single from Products to Orders
The formula filters Products by ProductName 'Chair' then filters Orders by matching ProductID via the relationship. The filter flows from Products to Orders.
Result
+-----------------------------+
| CALCULATE Result             |
|-----------------------------|
| 2                           |
+-----------------------------+
The final result shows 2, which is the total quantity of orders for the product 'Chair'. This is because only one order has ProductID 101 (Chair) with quantity 2.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the filter 'Products[ProductName] = "Chair"' do in the formula?
AFilters Orders table directly for 'Chair'
BKeeps only products named 'Chair' in the Products table
CRemoves all products except 'Table'
DFilters Orders for quantity greater than 2
Key Result
CALCULATE with filter on one table applies cross-filtering via relationship direction to related tables.