Dec 02 2021 02:03 AM
hi,
i am trying to get data from many files like these 2 attached.
Unfotunatelly, I get a lot of empty cells. i have tried to delete empty colonnes and rows but the Get Data funtion keeps on importing empty cells.
Can someone help me?
Thanks, Juan
Dec 02 2021 06:39 AM
SolutionYou may Clean All in source files, if by Power Query you may apply function on second step
(Source as table) as table =>
let
RemoveEmptyColumns = Table.SelectColumns(
Source,
List.Select(
Table.ColumnNames(Source),
each List.NonNullCount(Table.Column(Source,_)) <> 0
)
),
RemoveEmptyRows = Table.SelectRows(
RemoveEmptyColumns,
each not List.IsEmpty(List.RemoveMatchingItems( Record.FieldValues(_), {"", null} ) )
)
in
RemoveEmptyRows
Dec 02 2021 10:22 AM
Dec 02 2021 11:35 AM
1) it depends what your is your source. If From Folder you may keep file name. If From File you shall define filepath somehow. It could be parameter, whatever, you may add it as another column.
2) That's how query works, you need only to refresh it.
Dec 02 2021 06:39 AM
SolutionYou may Clean All in source files, if by Power Query you may apply function on second step
(Source as table) as table =>
let
RemoveEmptyColumns = Table.SelectColumns(
Source,
List.Select(
Table.ColumnNames(Source),
each List.NonNullCount(Table.Column(Source,_)) <> 0
)
),
RemoveEmptyRows = Table.SelectRows(
RemoveEmptyColumns,
each not List.IsEmpty(List.RemoveMatchingItems( Record.FieldValues(_), {"", null} ) )
)
in
RemoveEmptyRows