I'm using Power Query to consolidate a data table across multiple Excel workbooks. I'm using a Parameter table listing the source files and a function:
Code:
[
(filepath)=>
let
Source = Excel.Workbook(File.Contents(filepath), null, true),
TableofData= Source{[Item="MyTableName",Kind="Table"]}[Data]
in
TableofData
/CODE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Full source name[/TD]
[TD]Get Excel Data[/TD]
[/TR]
[TR]
[TD][URL="file://\\networkpath\filename1.xlsm"]\\networkpath\filename1.xlsm[/URL][/TD]
[TD]=MyFunction([Full Source Name])[/TD]
[/TR]
[TR]
[TD][URL="file://\\networkpath\filename2.xlsm"]\\networkpath\filename2.xlsm[/URL][/TD]
[TD]=MyFunction([Full Source Name])[/TD]
[/TR]
[TR]
[TD][URL="file://\\networkpath\filename3.xlsm"]\\networkpath\filename3.xlsm[/URL][/TD]
[TD]=MyFunction([Full Source Name])[/TD]
[/TR]
</tbody>[/TABLE]
This produces a table like
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Full source name[/TD]
[TD]Get Excel Data[/TD]
[/TR]
[TR]
[TD][URL="file://networkpath/filename1.xlsm"]\\networkpath\filename1.xlsm[/URL][/TD]
[TD]Table[/TD]
[/TR]
[TR]
[TD][URL="file://networkpath/filename2.xlsm"]\\networkpath\filename2.xlsm[/URL][/TD]
[TD]Table[/TD]
[/TR]
[TR]
[TD][URL="file://networkpath/filename3.xlsm"]\\networkpath\filename3.xlsm[/URL][/TD]
[TD]Table[/TD]
[/TR]
</tbody>[/TABLE]
I then click to "Expand" the Tables returned.
The problem is... this creates a line that explicitly states each column to expand. The tables I'm consolidating may have columns added/removed on a regular basis, so it needs to be dynamic and just expand "all" rather than specifying each column.
Is there a way using Table.ExpandTableColumn to expand all instead of requiring a list of each column?