Forum Discussion
Here4Help
1 year agoFrequent Visitor
Remove blank columns from all tables before combining the tables
Hi, So, I have these tables (around 100) which I want to combine. But I want to remove all empty columns in each of these tables before I combine them. Any help is really appreciated. Thanks...
- 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))
)
)}
)
slorin
Super User
1 year agoHi
= Table.TransformColumns(
Your_Source,
{{"Your_Column",
each Table.SelectColumns(
_,
Table.SelectRows(
Table.AddColumn(Table.Profile(_), "X", each [Count]<>[NullCount]),
each [X])[Column]),
type table}})
Stéphane