Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have two tables as below
Table 1
Part No. 202307 202308
| AA | 1 | 1 |
| BB | 1 | 1 |
| CC | 1 | 1 |
Table 2
Part No. 202309 202310
| AA | 1 | 1 |
| DD | 1 | 1 |
| EE | 1 | 1 |
Eventually, I would like to merge them and look like below
Part NO. 202307 202308 202309 202310
| AA | 1 | 1 | 1 | 1 |
| BB | 1 | 1 | ||
| CC | 1 | 1 | ||
| DD | 1 | 1 | ||
| EE | 1 | 1 |
When i merge them, I only managed to do like below
Even column merge, it appears like below
Please advise how I can achieve.
Thanks
Solved! Go to Solution.
Instead of Joining, you can
let
//Change both Source lines to reflect the actual source of the two tables
Source = Excel.CurrentWorkbook(){[Name="Table_1"]}[Content],
Table1 = Table.TransformColumnTypes(Source,{{"Part No.", type text}, {"202307", Int64.Type}, {"202308", Int64.Type}}),
Source2 = Excel.CurrentWorkbook(){[Name="Table_2"]}[Content],
Table2 = Table.TransformColumnTypes(Source2,{{"Part No.", type text}, {"202309", Int64.Type}, {"202310", Int64.Type}}),
//Combine the two tables
Combine = Table.Combine({Table1, Table2}),
//Then Group By Part No. and perform custom aggregation
#"Grouped Rows" = Table.Group(Combine, {"Part No."}, {
{"All", each Table.FillUp(_, Table.ColumnNames(_)){0}}}),
//Re-expand data and set the data types
#"Expanded All" = Table.ExpandRecordColumn(#"Grouped Rows", "All", {"202307", "202308", "202309", "202310"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded All",{{"202307", Int64.Type}, {"202308", Int64.Type}, {"202309", Int64.Type}, {"202310", Int64.Type}})
in
#"Changed Type"
Results
Instead of Joining, you can
let
//Change both Source lines to reflect the actual source of the two tables
Source = Excel.CurrentWorkbook(){[Name="Table_1"]}[Content],
Table1 = Table.TransformColumnTypes(Source,{{"Part No.", type text}, {"202307", Int64.Type}, {"202308", Int64.Type}}),
Source2 = Excel.CurrentWorkbook(){[Name="Table_2"]}[Content],
Table2 = Table.TransformColumnTypes(Source2,{{"Part No.", type text}, {"202309", Int64.Type}, {"202310", Int64.Type}}),
//Combine the two tables
Combine = Table.Combine({Table1, Table2}),
//Then Group By Part No. and perform custom aggregation
#"Grouped Rows" = Table.Group(Combine, {"Part No."}, {
{"All", each Table.FillUp(_, Table.ColumnNames(_)){0}}}),
//Re-expand data and set the data types
#"Expanded All" = Table.ExpandRecordColumn(#"Grouped Rows", "All", {"202307", "202308", "202309", "202310"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded All",{{"202307", Int64.Type}, {"202308", Int64.Type}, {"202309", Int64.Type}, {"202310", Int64.Type}})
in
#"Changed Type"
Results
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.