Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Combining columns from different Tables but in same orders

Dear Community Members,    Request your help with below query -   I have 14 tables with similar data and 5 columns per table   Example of two tables below:   Table 1 Cif ID Name 1711 ...
  • AlexisOlson's avatar
    4 years ago

    This pattern should work:

    let
        Source =
        Table.SelectColumns(
            Table.Combine(
                {
                    Table.RenameColumns(Table1, {{"ID1", "ID_Output"}, {"Name1", "Name_Output"}}),
                    Table.RenameColumns(Table2, {{"ID2", "ID_Output"}, {"Name2", "Name_Output"}}),
                    Table.RenameColumns(Table3, {{"ID3", "ID_Output"}, {"Name3", "Name_Output"}})
                }
            ),
            {"ID_Output", "Name_Output"}
        )
    in
        Source

    Update the column names as appropriate for your situation.