Skip to main content

Power BI

Needs Votes

Transform/Expand All with Code for Entire Table Instead of Listing All Fields Individually

Vote (1) Share
Jennifer Ratten's profile image

Jennifer Ratten on 03 Sep 2020 16:15:33

When transforming columns, if all columns in the table are selected, use a dynamic table transformation code instead of listing all fields individually, like Table.TransformColumns(Source, {}, Text.Clean) - or a code that applies the transformation to all table columns that fit in the transformation's scope, like Text.Clean would apply to all table columns that are of type text. It would also be nice to have a button in the UI that does this.

Likewise, when expanding all table columns, instead of listing all fields individually, insert the dynamic table code. Something like this...
Table.ExpandTableColumn(Source, "Table of Records", Table.ColumnNames(Table.Combine(Source[Table of Records])), Table.ColumnNames(Table.Combine(Source[Table of Records])))

Comments (2)
Jennifer Ratten's profile image Profile Picture

Pascal Bellerose on 10 Oct 2021 16:56:53

RE: Transform/Expand All with Code for Entire Table Instead of Listing All Fields Individually

Same would go for Table.Group function when using "all rows" aggregation. Every time I add a column in the previous steps, I must update this instruction manually.

Jennifer Ratten's profile image Profile Picture

Pascal Bellerose on 09 Oct 2021 20:55:18

RE: Transform/Expand All with Code for Entire Table Instead of Listing All Fields Individually

This is interesting when all columns were selected in the first place.
I would add to automatically add columns added to the input table.
Adjusting this instruction is not an obvious thing to do and there no way to detect if there is a column difference between before and after the Table.Group or Table.NestedJoin.
In any other languages never do we have to update the column list when performing table joins or group by.