Forum Discussion
Union Table in M Query
Hi Redzero1
You can use table.combine to combine. You need to make sure that all three tables have the same columns. In your case you want to create a new table with public fields (probably "Sales", "Amount" and "Date"), so first you need to select and rename the columns in each table to keep the columns Name consistency.
Please try the following:
Edit query per table.
Select and rename columns. Select only the "Sales", "Amount" and "Date" columns. If all column names already meet the requirements, there is no need to rename them.
After all three tables have the same column structure, you can use Table.Combine in a new query. This will create a new table that combines rows from all three tables.
Power Query is case-sensitive, so ensure column names in all tables match exactly. In the Table.Combine function, the column order of all tables should also be the same.
This approach will provide your Power BI model with a new table that summarizes information from three different tables based on the common fields you choose.
m code= Table.Combine({#"Table1", #"Table2", #"Table3"})
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.