RELATED and RELATEDTABLE in Power BI DAX
RELATED looks up a column from the one-side table into a many-side row; RELATEDTABLE returns the related many-side rows from a one-side row — both need an active relationship path in the model.
Chala mitrano! Relationships are the roads; RELATED and RELATEDTABLE are how DAX walks those roads. Why? Labels and counts across tables show up in every FreshBasket (fictional) model. How? Model view first, then one RELATED column and one RELATEDTABLE count. Clear and slow.
Quick answer
Vertical rules:
- Confirm an active many-to-one relationship (Sales → Product).
- On the many side:
ProductName = RELATED ( Product[Name] ). - On the one side:
SalesCount = COUNTROWS ( RELATEDTABLE ( Sales ) ). - Blank RELATED → bad keys, missing or inactive relationship.
- Prefer measures + relationships for totals; use RELATED for useful labels/flags.
- Star schema keeps these functions boring (in a good way).
RELATED → lookup to one-side column
RELATEDTABLE → table of many-side rows
Why RELATED, rows in / what comes out
Sales (many) and Product (one):
Sales
| Order ID | ProductKey | Amount | City |
|---|---|---|---|
| A | P1 | 100 | Mumbai |
| B | P1 | 40 | Mumbai |
| C | P2 | 80 | Nashik |
Product
| ProductKey | Name |
|---|---|
| P1 | Milk |
| P2 | Bread |
- Why RELATED: each Sales row needs the product name for a label.
- On Sales row A,
RELATED ( Product[Name] )walks the relationship. Result: Milk. - On Sales row C, result: Bread.
- Why RELATEDTABLE: on Product row P1,
RELATEDTABLE ( Sales )returns the two Mumbai milk lines. COUNTROWS ( RELATEDTABLE ( Sales ) )on P1 → 2. On P2 → 1.- Mumbai milk sales still total 140 when you SUM Amount on those two lines.
No active relationship → RELATED returns blank. The formula did not invent a join.
Both functions need an active relationship path. Broken or missing relationships → blank RELATED results.
मित्रांनो — Both functions need an active relationship path. Broken or missing relationships → blank RELATED results.
मित्रों — Both functions need an active relationship path. Broken or missing relationships → blank RELATED results.
What do I need before this guide?
- A model with at least one relationship (modelling course).
- Course: RELATED and RELATEDTABLE.
Before and after (look at the tables first)
Before
आधी (Before)
पहले (Before)
After
नंतर (After)
बाद में (After)
Model view before DAX
- Open Model view.
- Check Sales[ProductKey] → Product[ProductKey] (or your names).
- Active relationship line should be solid/active per Desktop UI.
- No path → RELATED cannot invent a join.
RELATED (many → one lookup)
RELATED pulls a value from the one-side table into a many-side row (lookup along a relationship).
मित्रांनो — RELATED pulls a value from the one-side table into a many-side row (lookup along a relationship).
मित्रों — RELATED pulls a value from the one-side table into a many-side row (lookup along a relationship).
Product Name =
RELATED ( Product[Name] )
- Written as a calculated column on Sales (many side).
- Pulls the product name for this row’s key.
- Handy for labels; do not replace every measure with columns.
Shop analogy: RELATED is reading the product name sticker from the master shelf list onto each order slip.
RELATEDTABLE (one → many table)
RELATEDTABLE returns the many-side rows related to the current one-side row — useful inside iterators on dimensions.
मित्रांनो — RELATEDTABLE returns the many-side rows related to the current one-side row — useful inside iterators on dimensions.
मित्रों — RELATEDTABLE returns the many-side rows related to the current one-side row — useful inside iterators on dimensions.
Sales Rows For Product =
COUNTROWS ( RELATEDTABLE ( Sales ) )
- Written on Product (one side) as a column or inside a measure iterator pattern.
- RELATEDTABLE returns the Sales rows related to this product.
- COUNTROWS turns that table into a count.
RELATED vs Power Query merge
- Merge in Power Query — reshape before the model; stored columns.
- RELATED in DAX — lookup using model relationships at evaluation time.
- Both valid; do not maintain two conflicting category columns without a reason.
Mistakes and calm fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| RELATED blank | No match / blank key / inactive rel | Fix keys; activate relationship |
| Cannot use RELATED | Wrong side of relationship | RELATED is from many toward one |
| Slow model | Too many RELATED columns | Prefer measures; slim columns |
| Wrong product name | Duplicate keys on one-side | Enforce unique dimension keys |
Ghabru naka 😅 — blank RELATED is a model detective case, not a DAX curse.
Ravindra Bagale's Tip
A common mistake: students learn RELATED and then merge the same columns in Query “for safety”, creating two truths. Pick one road for each field. Keep this in mind — model relationships are enough when the star is clean.
Ravindra Bagale's Tip – मराठी
एक common चूक: students RELATED शिकतात आणि मग Query मध्ये तेच columns “for safety” merge करतात — दोन truths तयार होतात. प्रत्येक field साठी एकच रस्ता निवडा. लक्षात ठेवा — star स्वच्छ असेल तर model relationships पुरेसे आहेत.
Ravindra Bagale's Tip – हिंदी
एक common गलती: students RELATED सीखते हैं और फिर Query में वही columns “for safety” merge करते हैं — दो truths बन जाती हैं. हर field के लिए एक ही रास्ता चुनो. याद रखो — star साफ हो तो model relationships काफी हैं.
Practice task
- Draw your Sales–Product relationship on paper.
- Add a RELATED column for product name or category.
- Add a COUNTROWS ( RELATEDTABLE ( Sales ) ) style count on Product.
- Intentionally break the relationship in a copy file and watch RELATED go blank — then fix it.
- Read the course RELATED lesson and tick matching ideas.
Learn it properly
Course lessons:
Related guides: ALL family · Row vs filter context · Measures vs columns
Samajla ka? RELATED = lookup to the one side. RELATEDTABLE = many-side rows. Relationships first, then DAX. Aata pudhe jaauya — KEEPFILTERS next.
Frequently asked questions
What does RELATED do?
From a many-side row, fetches a single value from the related one-side table along an active relationship.
What does RELATEDTABLE do?
From a one-side row, returns the set of related many-side rows as a table.
Why is RELATED blank?
No match on the key, blank key, missing relationship, or inactive relationship path.
RELATED vs merge in Power Query?
Query merge reshapes before the model; RELATED looks up at evaluation time using model relationships.
Can RELATED cross many hops?
It follows a relationship path; deep snowflakes get fragile — flatter stars are easier.
Course lesson?
RELATED and RELATEDTABLE in the DAX chapter.