Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Domenick
Helper IV
Helper IV

Related Function Not Working

I'm trying to bring a value from a related table, but the RELATED function keeps erroring on me.

 

My syntax is: 

 

P_PhaseName = RELATED(PIM_Project_Phases[Name])

 

and here's my relationship:

 

Capture.PNG

 

Some more context:

 

My "Project" table basically has a triple join to my Hours table (it joins on the project number, phase number, and task number); to get information on the phase, I need to join on both project and phase (and to get information about the task, I need to join on all three). I want to be able to create a hierarchy so that you can drill down from Project down to Phase and Task. In order to accomplish this, I'm joining the Hours table to three separate instances of the Project table. I figure that I'll bring in the info (i.e. name) I need from each of those tables into the hours table and create my hierarchy there. If there's a better way of accomplishing this, I'm all ears.

 

I've also considered just doing this all in SQL so that the Hours table already has all that information, but that might cause problems later on when I want more information from the project table.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Domenick 

In you case, try use RELATEDTABLE in Table A to call out Table B. 

Related() is used to refer to One side of a relationship. 

RELATEDTABLE() refer to the many side.

Please Refer to: https://theexcelclub.com/dax-power-pivot-power-bi-ssas-related-and-relatedtable/


Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Domenick 

In you case, try use RELATEDTABLE in Table A to call out Table B. 

Related() is used to refer to One side of a relationship. 

RELATEDTABLE() refer to the many side.

Please Refer to: https://theexcelclub.com/dax-power-pivot-power-bi-ssas-related-and-relatedtable/


Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

Well, many-to-many tends to be tricky, would recommend a bridge table. Also, RELATED is most likely bringing back multiple records so you might want to wrap it in an aggregation like MAXX or MINX. You might want to experiment with RELATEDTABLE.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.