Forum Discussion
juan jimenez
Apr 23, 2020Iron Contributor
power query remove empty columns
hi, Can anyone tell me if it is possible to "remove empty columns" as it is to "remove empty rows"? Thanks Juan
- Apr 24, 2020
If automatically that could be function like
(Source as table) as table => let RemoveEmptyColumns = Table.SelectColumns( Source, List.Select( Table.ColumnNames(Source), each List.NonNullCount(Table.Column(Source,_)) <> 0 ) ) in RemoveEmptyColumns
DhaniCole
Apr 24, 2020Brass Contributor
Depending on your table size, you could transpose the table in PQ, then filter out blank rows on a column, then transpose back.
To keep the column headers though, you should demote the headers before you transpose, then promote them after you transpose the table back.