Skip to main content

Joining Datasets using Multiple JOIN Conditions in Power BI

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 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. 




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 😃

Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. Invest with 200$ and get a returns of 5,000$ within seven business working days.
    Why 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

    ReplyDelete
  3. I think REST API and Power BI should actually be judiciously utilized in order to crack the most complex IT operations.

    Powerbi Read Rest

    ReplyDelete
  4. very nice and provide me informative content thanks for sharing for more information Looking for the best Business Intelligence reporting Services

    ReplyDelete
  5. Great article with very unique content.
    Thank you for sharing this awesome blog.
    Keep updating...

    Power BI Training

    ReplyDelete

Post a Comment

Popular posts from this blog

Step-by-Step Twitter Sentiment Analysis Using Power BI Streaming Dataset, Microsoft Flow and Azure Text API

Sentiment Analysis is known as Opinion mining or emotion AI which is a branch of Natural Language Processing and text analytics where systematically identify, extract, quantify, and study affective states and subjective information. This kind a analysis widely apply to analyse the product or service reviews, voice of the customer, survey responses from online and social media feeds to analyze the attitude of the customer. Basically from the sentiment analysis the output would be either Positive, Negative or Neutral.  There are various algorithms and methods to do a sentiment analysis out there. In this post here I'm doing a sentiment analysis for iPhone 8 product by analyzing twitter feeds. Because, I wanted to know what others are thinking about the latest phone released by Apple. In order to do this task I'm using,  Microsoft Azure cognitive services : Text Analytics (to run the sentiment analysis algorithms to get out the results)  Microsoft Flow ...

How to Get Row Counts for all Tables in your SQL Database

This is the simplest method to get the row counts of all tables in your SQL Server database. Might be useful when you are doing the data testing over your BI project.     select   schema_name (tab.schema_id) , tab.name  as  [table],         sum (part.rows)  as  [rows]     from  sys.tables  as  tab          inner join  sys.partitions  as  part              on  tab.object_id  =  part.object_id where  part.index_id  IN  ( 1 ,  0 )  //   0 :  Table   without  PK,  1 :  table   with  PK and   schema_name (tab.schema_id)  =   'dbo'   group by   schema_name (tab.schema_id) , tab.name --order by sum(part.rows) desc  

COVID-19 Situation in Sri Lanka: Real-time Dashboard using Power BI

[Updated on March 28, 2020] COVID-19  is a new strain that was discovered in late December, 2019 and by now it has been started to spread all over the world including 199 countries. There are around 26,000 people were died due to the virus and 580,000 confirmed cases at the moment I update this blog post. Though, the fatality rate is lower when compared to other viruses in similar strains like MERS and SARS . However, the biggest challenge most of the countries facing right now is to accommodate the patients with the growing numbers at every minute. The public was asked by the government to avoid nonessential gatherings as much as possible to stop spreading this deadly virus. Even though there were not many cases found in Sri Lanka, from March first week, they found the initial case a patient who works as a tourist. Now the situation is turning to worst after they found many cases especially tourists who are born Sri Lankans came down from Italy and European countries....