Forum Discussion
cimrman65
Jan 30, 2024Copper Contributor
Power Query: extract data from tables into multiple columns
Hi, I have multiple excel files with 3 columns that I want to merge into one sheet. If possible, I would like to have one empty column between each 3 columns. I figured out I would use power query fo...
SergeiBaklan
Jan 31, 2024Diamond Contributor
Back to Power Query, as variant.
If some step tables returns set of them like
steps could be
let
....
tables = ....,
headers = List.Combine(
List.Transform( tables[Tables],
(q) => List.Transform( Table.ColumnNames(q) & {"sp"},
(p) => p & Text.From( List.PositionOf(tables[Tables], q) ) ) ) ),
columns = List.Combine( List.Transform( tables[Tables], (q) => (Table.ToColumns(q) & {{}}) ) ),
result = Table.FromColumns( columns, headers )
in
result
which gives something like
- lmath1875Sep 30, 2024Copper Contributor
SergeiBaklan where would I enter the mentioned steps on Excel Power Query?
Would It be as a add custom column?- LorenzoSep 30, 2024Silver Contributor
Steps provided by SergeiBaklan must be added with Power Query Advanced Editor (option on the Home tab)