Hi all, completely new to power query just started playing with it but I got a question for you if you can help!
So I am trying to import data from a table inside excel A into excel B.
I want the user of excel A to be free to modify their table by moving columns around, renaming them, adding new columns, and removing columns as they are the owner of this file.
now inside excel B i want to make a mirror of the data in excel A by dynamicaly getting its column structure with any changes described above.
googling around I figured out that i can get the source table headers with something like that:
This gives me something like this
now my idea was to use the above approach in order to define the column structure inside my actual data query
does that make sense? how can this work in the final query?
could what i need be achieved in a different perhaps easier way?
thx!
So I am trying to import data from a table inside excel A into excel B.
I want the user of excel A to be free to modify their table by moving columns around, renaming them, adding new columns, and removing columns as they are the owner of this file.
now inside excel B i want to make a mirror of the data in excel A by dynamicaly getting its column structure with any changes described above.
googling around I figured out that i can get the source table headers with something like that:
Power Query:
let
Source = Excel.Workbook(File.Contents("C:\Excel A.xlsx")),
TBL_Source = Source{[Item="TBL_Source1", Kind="Table"]}[Data],
GetColumns = Table.ColumnNames(TBL_Source),
MakeATable = Table.FromList(GetColumns),
RenamedColumns = Table.RenameColumns(MakeATable, {{"Column1", "ColumnName"}})
in
RenamedColumns
This gives me something like this
now my idea was to use the above approach in order to define the column structure inside my actual data query
does that make sense? how can this work in the final query?
could what i need be achieved in a different perhaps easier way?
thx!