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.
Product Table
Manufacturer Table
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:
Step 01:
Select Home > Transform Data.
Step 02:
Then go to Home Ribbon. Click on Append Queries Drop-down. You’ll get two options.
- Merge Queries
- Merge Queries as New
Step 03:
When we will click Merge Queries as New a new window will appear as shown below.
Step 04:
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).
Step 05:
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.
Step 06:
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).
Step 07:
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.
Step 08:
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.
Thanks