Forum Discussion
Remove blank columns from all tables before combining the tables
- 1 year ago
It might be beacuse of the data type or the previous step you are refrencing try this please
Table.TransformColumns(
#"previous step",
{"Custom", each Table.RemoveColumns(
_,
List.Select(
Table.ColumnNames(_),
(x) => List.AllTrue(List.Transform(Table.Column(_, x), (y) => y = "" or y = null))
)
)}
)
Hi first
Connect to your Excel files in Power Query and load the "Table" objects.
Remove blank columns: Add a custom column with this formula to filter out empty columns dynamically
Table.SelectColumns([Custom], List.Select(Table.ColumnNames([Custom]), each List.NonNullCount(Table.Column([Custom], _)) > 0))
Then Expand them
- Here4Help1 year agoFrequent Visitor
Thanks. I tried it and I am getting this error.
- Akash_Varuna1 year ago
Super User
It might be beacuse of the data type or the previous step you are refrencing try this please
Table.TransformColumns(
#"previous step",
{"Custom", each Table.RemoveColumns(
_,
List.Select(
Table.ColumnNames(_),
(x) => List.AllTrue(List.Transform(Table.Column(_, x), (y) => y = "" or y = null))
)
)}
)- Here4Help1 year agoFrequent Visitor
Thanks a lot. That worked in removing the blank columns. However, now all the sheets have different column names (although data is in correct order). And when I use Table.combine to combine the sheets, it is combining by column names.
Is there a way to ignore the column names while using Table.combine?
Thanks