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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply

Loading multiple SharePoint document tables into the same query

Hi folks, I'm hoping someone might be able to assist.

I have a single SharePoint site with multiple document libraries. Each library has identical columns, but is used for different document types. I'm trying to find an elegant way to bring every library into the same PowerBI query for modelling, rather than loading each library separately. Here are my libraries:

MichaelHutchens_0-1637687006565.png

 

And here is my current code after I've loaded the first library ("Communications"):

 

 

let
    Source = Table.Combine(
        {
        SharePoint.Tables("https://SITE_URL_GOES_HERE/", [ApiVersion = 15])
        }
    ),
    #"cbbe7c42-9d75-4d3e-9bd9-4260ef76c25f" = Source{[Id="cbbe7c42-9d75-4d3e-9bd9-4260ef76c25f"]}[Items],
    #"Renamed Columns" = Table.RenameColumns(#"cbbe7c42-9d75-4d3e-9bd9-4260ef76c25f",{{"ID", "ID.1"}})
in
    #"Renamed Columns"

 

 


Is there a way to modify this code to load the 4 libraries above?

Thanks in advance for your time 🙂

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You can filter based on [Title] and then expand on [Items] like this:

let
    Source = Table.Combine(
        {
        SharePoint.Tables("https://SITE_URL_GOES_HERE/", [ApiVersion = 15])
        }
    ),
    #"Filtered Rows" = Table.SelectRows(Source, each
        ([Title] = "Communications" or
         [Title] = "Forms" or
         [Title] = "Guides" or
         [Title] = "Images"
        )
    ),
    #"Expanded Items" = Table.ExpandTableColumn(
        #"Filtered Rows", "Items",
        {"Title", "Created"},
        {"Title", "Created"}
    )
in
    #"Expanded Items"

 Replace "Title" and "Modified" with whatever columns you actually want.

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

You can filter based on [Title] and then expand on [Items] like this:

let
    Source = Table.Combine(
        {
        SharePoint.Tables("https://SITE_URL_GOES_HERE/", [ApiVersion = 15])
        }
    ),
    #"Filtered Rows" = Table.SelectRows(Source, each
        ([Title] = "Communications" or
         [Title] = "Forms" or
         [Title] = "Guides" or
         [Title] = "Images"
        )
    ),
    #"Expanded Items" = Table.ExpandTableColumn(
        #"Filtered Rows", "Items",
        {"Title", "Created"},
        {"Title", "Created"}
    )
in
    #"Expanded Items"

 Replace "Title" and "Modified" with whatever columns you actually want.

Fabulous, that's perfect - thanks so much @AlexisOlson 🙂

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.