Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have 2 tables viz., Table 1 & Table 2.
Table 1 has standard columns (shown in bold) with some extra columns `Manual col1, `Manual col2, `Manual col3 etc.
WB Study ID | Commissioning Country | Project Name | Field Start Date | Study Delivery Date | Client | Local Amount | Local Currency | IBP | Finance Coordinator | Study Status | Manual col 1 | Manual col 2 | Manual col 3 |
Table 2 has only the standard columns (shown in bold):
WB Study ID | Commissioning Country | Project Name | Field Start Date | Study Delivery Date | Client | Local Amount | Local Currency | IBP | Finance Coordinator | Study Status |
I want to add the extra columns from Table 1 to Table 2, as blank or null columns, but keeping their data types intact. This is so that i can later merge new or updated data in Table 2 to Table 1.
Is there a quicker way to do this, instead of writing 3 Table.AddColumn() ?
Solved! Go to Solution.
You can append an empty copy of Table1 to Table2 and it'll add the extra columns.
Table.Combine({Table2, Table.SelectRows(Table1, each false)})
To generate this step, go to your Table2 query and click Append Queries (Home tab) then select Table1.
Then replace Table1 in the generated M code with Table.SelectColumns(Table1, each false).
You can append an empty copy of Table1 to Table2 and it'll add the extra columns.
Table.Combine({Table2, Table.SelectRows(Table1, each false)})
To generate this step, go to your Table2 query and click Append Queries (Home tab) then select Table1.
Then replace Table1 in the generated M code with Table.SelectColumns(Table1, each false).
The problem is, table1 and table2 are not empty.
Why is that a problem? I just explained how to get an empty copy.
True. But it doesn't copy the Table1's data types, but changes all to Text.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.