Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

How best to join two tables with multiple keys? Is creating composite join best solution?

I have a table that needs to be joined with another table using three keys. Is the only option to concatenate the three columns to make a unique key?

 

More specifically, I have two tables both which contain an Item, a Month, and a Location. By combining Item + Month + Location this creates a unique key where I can combine to the other table. Is the best way to join by creating a new column and combining the three columns into one field? I tried linking the tables together using the three fields and I start getting all of these warning and errors. Looking at other posts it sounds like the solution is to do a composite join (I would think PowerBI could deal with this without adding other columns)

 

Example of how data looks:

2 Replies

  • iamprajot's avatar
    iamprajot
    Icon for Responsive Resident rankResponsive Resident
    You can have 1 active relationship and rest all inactive relationship and use those inactive relationships in dax calculations using userelationship function inside calculate.
  • v-diye-msft's avatar
    v-diye-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous 

     

    you might consider creating pbix file that will contain some sample data (remove the confidential info), upload the pbix to onedrive for business and share the link to the file. Please do not forget to describe the expected results based on this sample data.