In this blog, we will be merging two different queries using Power BI. This feature is very useful if you want to combine one or more columns with another query using Power BI.
In the above screenshot, we have a Product table with product details in it and a Manufacturer table with manufacturer’s details in it.
We must bring the Manufacturer name which is in the Manufacturer table to the Product table using merge queries as new.
Now, we’ll combine the above 2 tables’ data. Below are the steps to merge them:
Select Home > Transform Data.
Then go to Home Ribbon. Click on Append Queries Drop-down. You’ll get two options.
- Merge Queries
- Merge Queries as New
When we will click Merge Queries as New a new window will appear as shown below.
After the above window appears. Select the table and the column based on which you must perform the merge query also select the ‘Join Kind’ i.e., which kind of join do you want to perform? Here we are performing ‘Left Outer Join’. After selecting both tables and columns and the Join Kind click OK to merge both tables (Product & Manufacturer).
After clicking OK your tables will be merged as a New Table ‘Merge1’. There you’ll get a new column ‘Manufacturer’ from the manufacturer table as we need to bring Manufacture Name to the Product table.
We’ll click on the drop-down button on the new column and select ‘Manufacturer’ and click ‘OK’ to get the name of the Manufacturer. You can also rename the table (Merge1 to Merge).
After clicking ‘OK’ the column will be expanded, and you’ll get the name of the manufacturers. We can also rename the column name (Manufacturer to Manufacturer Name). And click the Close and Apply button present in the ‘Home’ tab Ribbon to save all the changes.
In the below screenshot, you will be able to see the new merged table as Merge.
So, in this blog, we have learned how to merge queries.