Reputation: 249
In PowerBI, M-language I need to remove a specific column number (number 5) for each table column in multiple files. So far I have managed to remove the column by name, but the naming of column 5 varies, I want to remove the column by its columnnumber instead of its columnname.
= Table.RemoveColumns(
Table.PromoteHeaders(Csv.Document([Content], [Delimiter = ";", Columns = 11, Encoding = 1252])),
"ColumnName"
)
Thanks in advance
Upvotes: 0
Views: 1471
Reputation: 21318
= Table.RemoveColumns(x,Table.ColumnNames(x){4})
so then probably
= Table.RemoveColumns(
Table.PromoteHeaders(Csv.Document([Content], [Delimiter = ";", Columns = 11, Encoding = 1252]))
, Table.ColumnNames(Table.PromoteHeaders(Csv.Document([Content], [Delimiter = ";", Columns = 11, Encoding = 1252]))){4}
)
Upvotes: 1