Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I need ti union two tables from SQL Server in power BI. But the issue is that the number of columns are not same for both the tables. So union()/concadenate() is not possible in Power BI.
So I tried the append and connected to Database.
It is good but the values are wrong.
So there any other ways to union these two tables in Power BI
Solved! Go to Solution.
Hi, @asdf1608
According to your description, you want to union the two tables which has differnt column names.
Here are the steps you can refer to :
This is my test data:
[1]We can crealize it in Power Query Editor. we can create a Blank Query and enter this:
= Table.RenameColumns(#"Table 2",{{"Stu_Name", "Name"}, {"Class_Name", "Class"}}) & #"Table 1"
Then we can get this and you can also remove the column you do not want to in it :
[2]We can also realize it in Power Bi Desktop:
We can click "New Table" and enter this:
Table = UNION( SELECTCOLUMNS( ADDCOLUMNS('Table 2',"Teacher", BLANK()) ,"Name",[Stu_Name],"Class",[Class_Name],"Source",[Source],"Teacher",[Teacher]) , 'Table 1')
Then we can also meet your need:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi, @asdf1608
According to your description, you want to union the two tables which has differnt column names.
Here are the steps you can refer to :
This is my test data:
[1]We can crealize it in Power Query Editor. we can create a Blank Query and enter this:
= Table.RenameColumns(#"Table 2",{{"Stu_Name", "Name"}, {"Class_Name", "Class"}}) & #"Table 1"
Then we can get this and you can also remove the column you do not want to in it :
[2]We can also realize it in Power Bi Desktop:
We can click "New Table" and enter this:
Table = UNION( SELECTCOLUMNS( ADDCOLUMNS('Table 2',"Teacher", BLANK()) ,"Name",[Stu_Name],"Class",[Class_Name],"Source",[Source],"Teacher",[Teacher]) , 'Table 1')
Then we can also meet your need:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
48 | |
31 | |
27 | |
27 | |
26 |
User | Count |
---|---|
61 | |
56 | |
35 | |
29 | |
28 |