Joining datasets is a norm in any ETL process specially if you are working with more than one dataset. In Power BI, joining two datasets is super easy, even it is easier than you joining two tables in T-SQL. Thanks for the powerful Power Query language you can perform joining tasks visually. However, sometimes you may get confuse the joining in Power BI because there are close similarities in UI for Joining datasets and Build relationships between datasets. However, my today post is not about How to Join two tables in Power BI. For that, you can read my article on Demystify Joins in Power BI.
In order to join these two tables in Power BI, go to Query Editor, it will open the Power Query Editor then you can select Merge Queries to join two tables.
Select the Sales table as the first table. Product table as the second table. In order to select multiple columns to join, hold Ctrl and select the fields.
Hope you learn how to join two datasets using multiple join conditions in Power BI 😃
In this article I'm going to explain to you how to join two datasets using multiple join conditions. I'm sure you have performed this task in SQL many times before.
Scenario
Assume that I have two tables, Product Table and Sales Table. In my product table I have, Product ID, Product, Color and Unit Price.
My Sales table contain daily sales information along with the Product and Product Color.
In this Sales Table, instead of storing Product and Color columns if we can bring a ProductID column, it would be ideal in many ways. In order to do that I require to join the Sales and Product table with multiple join conditions.
If we simulate this using basic T-SQL code, the code would be like this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT S.* , P. ProductID | |
FROM Sales S | |
LEFT JOIN Product P ON S.Product = P.Product AND S.Color = P.Color |
In order to join these two tables in Power BI, go to Query Editor, it will open the Power Query Editor then you can select Merge Queries to join two tables.
Select the Sales table as the first table. Product table as the second table. In order to select multiple columns to join, hold Ctrl and select the fields.
Ctrl + Select columns
Hope you learn how to join two datasets using multiple join conditions in Power BI 😃
This comment has been removed by the author.
ReplyDeleteInvest with 200$ and get a returns of 5,000$ within seven business working days.
ReplyDeleteWhy wasting your precious time online looking for a loan? When there is an opportunity for you to invest with 200$ and get a returns of 5,000$ within seven business working days. Contact us now for more information if interested on how you can earn big with just little amount. This is all about investing into Crude Oil and Gas Business.
Email: investmoneyoilgas@gmail.com
I think REST API and Power BI should actually be judiciously utilized in order to crack the most complex IT operations.
ReplyDeletePowerbi Read Rest
Thanks.
ReplyDeletePower BI Training In Hyderabad
Power BI Training
Power BI Online Training
Power BI Training Online
Nice blog,Thanks for sharing.
ReplyDeletePower Bi Online Training
Power Bi Online Training in usa
power Bi Online Training in Uk
best Power Bi Online Training
Power Bi Online Training with job Support
very nice and provide me informative content thanks for sharing for more information Looking for the best Business Intelligence reporting Services
ReplyDeleteGreat article with very unique content.
ReplyDeleteThank you for sharing this awesome blog.
Keep updating...
Power BI Training