Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
StoryofData
Helper III
Helper III

SharePoint: Read all Files and All Tabs except certain tabs

Hi there, 

I am trying to read all files in a sharepoint folder and all tabs within those .xlsx files, except tabs that contain "Summary".

All file names are different and all tab names are different. 


I am trying to accomplish this in advanced editor: 

let

    Source = SharePoint.Files("https:Path ", [ApiVersion = 15]),

    #"Filtered Rows" = Table.SelectRows(Source, each ([Folder Path] = "https:Path")),

   

    KeepCol = Table.SelectColumns(Source,{"Name"}),

    Sheet_Info = Table.AddColumn(KeepCol, "Personalise", each Excel.Workbook(File.Contents("https:Path" & [Name])),

 

    ExpandSheet = Table.ExpandTableColumn(Sheet_Info, "Personalise", {"Name", "Data"}, {"Name.1", "Data"}),

    Test = Table.AddColumn(ExpandSheet, "Flag", each Text.Contains([Name.1],"Summary")),

    KeepTrue = Table.SelectRows(Test, each ([Flag] = true)),

    Develop = Table.ExpandTableColumn(KeepTrue, "Data", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6"}))

 

    in

     #"Filtered Rows"

 

but my syntax is not working, can someone please help me? 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Something like this

 

// Downloads
let
    Source = Folder.Files("C:\Users\xxx\Downloads"),
    #"Filtered Rows1" = Table.SelectRows(Source, each Text.StartsWith([Name], "Book") and [Extension] = ".xlsx"),
    #"Added Custom" = Table.AddColumn(#"Filtered Rows1", "Custom", each Excel.Workbook([Content])),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Name","Custom" }),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"Data", "Kind", "Name"}, {"Data", "Kind", "Name.1"}),
    #"Filtered Rows" = Table.SelectRows(#"Expanded Custom", each [Name.1] <> "Summary")
in
    #"Filtered Rows"

 

lbendlin_0-1743706666374.png

 

 

 

View solution in original post

3 REPLIES 3
StoryofData
Helper III
Helper III

@lbendlin Thank you for your reply 🙂 I added your syntax in, with the exception of last #Filtered Rows was changed to #Filtered Rowss because it gave me an error of "The variable named 'Filtered Rows' is already defined in scope. 

I am experiencing issue at Filtered Rows1 step, after this,table shows up empty.

 

StoryofData_0-1743710780715.png

StoryofData_1-1743711041959.png

 

 





lbendlin
Super User
Super User

Something like this

 

// Downloads
let
    Source = Folder.Files("C:\Users\xxx\Downloads"),
    #"Filtered Rows1" = Table.SelectRows(Source, each Text.StartsWith([Name], "Book") and [Extension] = ".xlsx"),
    #"Added Custom" = Table.AddColumn(#"Filtered Rows1", "Custom", each Excel.Workbook([Content])),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Name","Custom" }),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"Data", "Kind", "Name"}, {"Data", "Kind", "Name.1"}),
    #"Filtered Rows" = Table.SelectRows(#"Expanded Custom", each [Name.1] <> "Summary")
in
    #"Filtered Rows"

 

lbendlin_0-1743706666374.png

 

 

 

Never mind, I fugred it out! Thank you so much! 🙂

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors