Forum Discussion

PowerBI123456's avatar
PowerBI123456
Post Partisan
5 years ago
Solved

Related within Related

Hi,

 

I have 2 tables connected by a dimension table since I cant connect the other 2 without doing a many to many relationship. I need to do a variable where 2 fields from my fact tables are connected, can I do the related function within another related function? 

 

 

  • Hi  PowerBI123456 ,

     

    Not sure the " many to many relationship" you mentioned is created based on the fields you wanna connect or another column which has been connected  with a dimension tabel.

    It is important to be sure that  in the 2  fact tables,there is a unique column that can be identified.

    I made a sample .pbix file,see below:

     

    In my example,in the 2 fact tables,I both added an index column,then create a measure as below:

    Measure = LOOKUPVALUE('Table2'[Category],Table2[Index],MAX('Table1'[Index]),0)

    And you will see:(2 fields from fact tables  have been connected)

    For the related .pbix file,pls see attached.

     

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!

2 Replies

  • v-kelly-msft's avatar
    v-kelly-msft
    Community Support

    Hi  PowerBI123456 ,

     

    Not sure the " many to many relationship" you mentioned is created based on the fields you wanna connect or another column which has been connected  with a dimension tabel.

    It is important to be sure that  in the 2  fact tables,there is a unique column that can be identified.

    I made a sample .pbix file,see below:

     

    In my example,in the 2 fact tables,I both added an index column,then create a measure as below:

    Measure = LOOKUPVALUE('Table2'[Category],Table2[Index],MAX('Table1'[Index]),0)

    And you will see:(2 fields from fact tables  have been connected)

    For the related .pbix file,pls see attached.

     

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!