In Power BI you can create relationship between tables but there is some limitation with Power BI relationship, like you cannot create relationship(or join two tables) with multiple columns.
But in Power Query you can join tables with multiple columns conditions, under merge queries you can perform with all joins, so lets get started-
Dataset sample as below:
Table 1: UserDetail
Now follow these steps
Step-1: Click on Transform data
Step-2: Power Query Editor window will be open, now under Home tab > Click on Merge Queries as new.
Merge Queries as new: Will return the join output as a new dataset.
Step-3: Now, we will join two tables with multiple columns conditions, you can select multiple columns to using Ctrl + Click.
- Choose UserDetail table from first dropdown, and select Customer & City column to using Ctrl + Click.
- Choose UserAmount table from second dropdown, and select User & City column to using Ctrl + Click.
- In Join kind select Inner Join.
- Click on OK.
Make sure you followed the same sequence of column selection for both tables, in other words if you want to join tables with condition like-
UserDetail(customer) with UserAmount(User) & UserDetail(City) with UserAmount(City), then column selection sequence will be same like, if you select Customer then City for first table then for second table you have to select User first then City.
Because based on selection sequence Power Query will create the join condition and return the data.
Step-4: New dataset has been created, now click on expand icon as shown in below screen shot & select column which you want to add in table, then click on OK.
Step-5: Now you can see the final output of Join with multiple column condition.
Refer Power BI other post: Power BI tutorials
Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our contact form , we will revert to you asap.