Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi everyone!
I have a query than combine xlsx from a folder of sharepoint online. The files arrives automatically.
Files usually have several columns with data. But in some cases arrives files with no info, and the format is just the first row:
"No results returned."
How can i filter that files? I guess, when I make Table.SelecRows I should put some kind of filter, but how?
Thanks in advance!
let
Source = SharePoint.Files("https://xxxx.sharepoint.com/teams/xxxx/", [ApiVersion = 15]),
#"Filtered rows" = Table.SelectRows(Source, each [Folder Path] = "https://xxxx.sharepoint.com/teams/xxxx/folder/folder/"),
#"Expanded Attributes" = Table.ExpandRecordColumn(#"Filtered rows", "Attributes", {"Size"}, {"Attributes.Size"}),
#"Filtered hidden files" = Table.SelectRows(#"Expanded Attributes", each [Attributes]?[Hidden]? <> true),
#"Invoke custom function" = Table.AddColumn(#"Filtered hidden files", "Transform file", each #"Transform file"([Content])),
#"Renamed columns" = Table.RenameColumns(#"Invoke custom function", {{"Name", "Source.Name"}}),
#"Removed other columns" = Table.SelectColumns(#"Renamed columns", {"Source.Name", "Transform file"}),
#"Expanded table column" = Table.ExpandTableColumn(#"Removed other columns", "Transform file", Table.ColumnNames(#"Transform file"(#"Sample file"))),
#"Transform columns" = Table.TransformColumnTypes(#"Expanded table column", {{XXXX}}),
#"Replace errors" = Table.ReplaceErrorValues(#"Transform columns", {{XXXXX}})
in
#"Replace errors"
Solved! Go to Solution.
I find a solution. When I filter the files, I select those that have more than 2 columns.
#"Filtered rows" = Table.SelectRows(Source, each [Folder Path] = "https://xxxx.sharepoint.com/teams/xxxx/xxxx/" and Table.ColumnCount(Excel.Workbook([Content], null, true){[Item = "Sheet_name", Kind = "Sheet"]}[Data])>2)
I find a solution. When I filter the files, I select those that have more than 2 columns.
#"Filtered rows" = Table.SelectRows(Source, each [Folder Path] = "https://xxxx.sharepoint.com/teams/xxxx/xxxx/" and Table.ColumnCount(Excel.Workbook([Content], null, true){[Item = "Sheet_name", Kind = "Sheet"]}[Data])>2)