Search code examples
powerbipowerquerym

Power query append multiple tables with single column regardless column names


I have the following query in M:

= Table.Combine({
Table.Distinct(Table.SelectColumns(Tab1,{"item"})),
Table.Distinct(Table.SelectColumns(Tab2,{"Column1"}))
})

Is it possible to get it working without prior changing column names?

I want to get something similar to SQL syntax:

select item    from Tab1 union all
select Column1 from Tab2

Solution

  • If you need just one column from each table then you may use this code:

    = Table.FromList(List.Distinct(Tab1[item])
                   & List.Distinct(Tab2[Column1]))