0
0
Tableaubi_tool~10 mins

Data relationships model in Tableau - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sample data showing two tables: Orders (A1:D4) and Customers (F1:H3). Orders has sales data linked to customers by Customer ID.

CellValue
A1Order ID
B1Customer ID
C1Order Date
D1Sales
A21001
B2C001
C22024-01-10
D2250
A31002
B3C002
C32024-01-15
D3450
A41003
B4C001
C42024-01-20
D4300
F1Customer ID
G1Customer Name
H1Region
F2C001
G2Alice
H2North
F3C002
G3Bob
H3South
Formula Trace
SUMX(RELATEDTABLE(Orders), Orders[Sales])
Step 1: RELATEDTABLE(Orders) for Customer ID 'C001'
Step 2: SUMX(Orders[Sales]) over related rows
Cell Reference Map
Orders Table       Customers Table
+----+----------+------------+-------+    +----------+--------------+--------+
| A1 | B1       | C1         | D1    |    | F1       | G1           | H1     |
|----|----------|------------|-------|    |----------|--------------|--------|
|1001| C001     | 2024-01-10 | 250   |    | C001     | Alice        | North  |
|1002| C002     | 2024-01-15 | 450   |    | C002     | Bob          | South  |
|1003| C001     | 2024-01-20 | 300   |    +----------+--------------+--------+
The formula uses Customer ID to relate Orders table rows to Customers table rows. The relationship is on Customer ID column in both tables.
Result
+----------+--------------+----------------+
| Customer | Total Sales  | Explanation    |
+----------+--------------+----------------+
| Alice    | 550          | Sum of sales for orders 1001 and 1003
| Bob      | 450          | Sum of sales for order 1002
+----------+--------------+----------------+
The result shows total sales per customer by summing sales from related orders using the data relationship on Customer ID.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does RELATEDTABLE(Orders) return for Customer ID 'C001'?
AAll customers with orders
BAll orders with Customer ID 'C001'
CSum of sales for all customers
DSingle order with highest sales
Key Result
RELATEDTABLE returns all rows from a related table matching the current row's key, used with aggregation functions like SUMX to calculate totals.