Forum Discussion
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:
and here's my relationship:
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.
- Anonymous6 years ago
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.
2 Replies
- Greg_DecklerCommunity ChampionWell, 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.
- AnonymousNot applicable
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.