Power Query + SharePoint: A Complete Guide to Lists, Folders, and Files

Oct 22, 2026 • 7 min read

Getting information from SharePoint into Excel with Power Query should be simple. And it is, once you know which connector to use and which part of the URL it expects.

That is where the confusion starts. There are two list connectors, a folder connector that initially returns files from the entire site, and a way to connect to individual files that does not mention SharePoint at all.

We can make sense of it by separating the task into three scenarios:

  • SharePoint lists: Connect to the site, then select the list.
  • SharePoint folders: Connect to the site, then filter the file listing or navigate through the folders.
  • Individual files: Copy the file’s direct path and use the From Web connector.

What You'll Learn

  • Use the site URL for SharePoint lists and folders, but the full direct URL for individual files.
  • Compare the two SharePoint list connectors when you need additional record metadata.
  • Navigate with SharePoint.Contents when retrieving a site-wide file listing is too slow.
  • Create SharePoint connections with M code when the folder connector is missing from Excel’s menus.

Table of Contents

Connect to a SharePoint List with Power Query

To import a SharePoint list into Excel, we first connect to the site containing the list. We do not start with the full address of the list itself.

1. Copy the SharePoint site URL

Open the list in SharePoint and look at the browser’s address bar. Keep the address through the site name. Its structure looks like this:

https://company.sharepoint.com/sites/SiteName

We need the protocol, the company’s SharePoint domain, /sites/, and the site name. Leave out the remaining list address.

For a list saved in your personal Microsoft Lists area, the address has a different structure. The principle is the same: identify and copy the underlying site address rather than the full list page URL.

2. Choose a list connector in Excel

On Excel’s Data tab, select Get Data. There are two relevant options:

  • From Online Services > From SharePoint Online List
  • From Other Sources > From SharePoint List

These are different connectors. They accept the same site URL, but they can expose different metadata about the list records. If one connector does not return the additional information you need, it is worth investigating the other.

For this example, choose From SharePoint Online List and paste the site URL.

3. Select the implementation and view mode

The connection dialog includes implementation options. Implementation 1.0 does not provide a view-mode setting. Implementation 2.0 provides two choices:

  • All: Returns all the columns from the SharePoint list.
  • Default: Uses the list’s default view.

I’m using Implementation 2.0 with All so we can inspect the available columns and decide which ones to keep.

SharePoint Online Lists dialog showing the site URL, implementation options, and view mode

4. Sign in and select the list

  1. Click OK to submit the connection settings.
  2. If prompted, select the account authentication option and click Sign in.
  3. Sign in with the account that has access to the site, then click Connect.
  4. In Navigator, select the list you need. My sample list is called PQ Example.
  5. Click Transform Data to open Power Query Editor.

If your account is already recognized, you may not need to enter your password again.

5. Keep the columns you need

The query contains the list’s data columns, along with additional metadata columns. In my example, many of those extra columns contain predominantly null values, and we do not need them.

Select the columns you want to retain, right-click a selected column header, and choose Remove Other Columns.

In the sample list, I keep the original data columns through Status. That leaves us connected to the SharePoint list without the unnecessary metadata.

Do check those additional columns before removing them. Depending on the connector and your reporting requirements, some of that record information may be useful.

Connect to a SharePoint Folder Containing Multiple Files

Now we need to connect to a folder. My example has three files inside Documents > Data > Combine.

Here is the important point: the SharePoint Folder connector starts with the site, not the individual folder. Once connected, we narrow the results to the files we need.

1. Get the site address

For SharePoint, copy the address from the browser through the site name, just as we did for the list:

https://company.sharepoint.com/sites/SiteName

Do not paste the full browser address for the folder into the connector.

Getting the equivalent address from OneDrive

For a work or school OneDrive location, the browser may show a navigation URL that is not suitable for this connection. Instead:

  1. Open the Details pane for the relevant item.
  2. Scroll down to Path.
  3. Click Copy direct link.
  4. Paste the address into a text editor so you can identify the site portion.

For this type of OneDrive address, keep the domain and the path through /personal/ and your personal site name. Leave out the document library, folders, and any filename that follow it.

The address format is different from a SharePoint team site, but the purpose is the same: we need the underlying site URL.

2. Use the SharePoint Folder connector

  1. In Excel, select Data > Get Data > From File > From SharePoint Folder.
  2. Paste the site URL and click OK.
  3. Authenticate if prompted.
  4. When the file preview appears, click Transform Data.

The resulting query lists files across the SharePoint site. It is not restricted to the folder you had open in your browser.

If you do not have a From SharePoint Folder menu option, do not worry. We can create the connection directly with a blank query, which I’ll cover shortly.

3. Filter the Folder Path column

To isolate the sample files:

  1. Find the Folder Path column.
  2. Open its filter menu.
  3. Select Text Filters > Contains.
  4. Enter /Data/Combine, matching the text in your folder path.
  5. Click OK.
Power Query Filter Rows dialog with a contains condition for the Folder Path column

That reduces the site-wide listing to the three files in our example folder.

This approach works, but there is a catch. If the SharePoint site contains a lot of files, retrieving the site-wide file listing can be very slow. Filtering the result does not change the fact that we started with that broad listing.

Use SharePoint.Contents to Navigate Through Folders

Rather than listing all the files and filtering afterward, we can navigate through the site’s folder structure. This is often a better approach for a large SharePoint site.

The SharePoint Folder connector creates a source using SharePoint.Files. To navigate by folder, change that function to SharePoint.Contents.

Change the source function

  1. If you have already added the Folder Path filter, remove that filtering step.
  2. Select the Source step.
  3. In the formula bar, replace SharePoint.Files with SharePoint.Contents.
  4. Keep the site URL and options in place, then commit the change.

Instead of the flat file listing, you now have a navigable set of site contents. Click the Table value in the relevant row’s Content column to move into each level.

For my example, the route is:

  1. Shared Documents
  2. Data
  3. Combine

We arrive at the same three files, but this time by navigating through the folders.

Power Query showing folder rows with Table values in the Content column
Click a Table value in the Content column to move into that folder.

The distinction is useful:

  • SharePoint.Files: Start with a site-wide file listing, then filter it.
  • SharePoint.Contents: Start with the site contents, then navigate through libraries and folders.

Microsoft’s references for SharePoint.Files and SharePoint.Contents explain the functions and their available options.

Create the connection without the menu option

Some Excel installations have not exposed the SharePoint Folder connector in the interface, even though the underlying Power Query functions are available.

In that situation, create a Blank Query and enter the source expression directly into the formula bar. For folder navigation, use:

= SharePoint.Contents(
    "https://company.sharepoint.com/sites/SiteName",
    [ApiVersion = 15]
)

For the site-wide file listing, use:

= SharePoint.Files(
    "https://company.sharepoint.com/sites/SiteName",
    [ApiVersion = 15]
)

Replace the example URL with your actual site address. The options record, including ApiVersion, goes inside square brackets.

Commit the expression and sign in if required. You can then continue with the same filtering or folder-navigation steps. The missing button does not necessarily mean the connection itself is unavailable.

Connect to a Single SharePoint File with From Web

For an individual file, we can take a more direct route. We do not need to retrieve the site’s file listing first.

Instead, use the file’s direct path with From Web. There is no SharePoint-specific connector involved in this approach.

1. Copy the file’s direct path

  1. In SharePoint, select the file you want to import.
  2. Open the Details pane.
  3. Scroll down to Path.
  4. Click Copy direct link.

The same process applies to the OneDrive location used here: select the file, open Details, and copy its direct path.

Keep the full file URL this time. For lists and folders, we extracted the site address. For an individual file, we need the address all the way through to the filename.

2. Connect through Excel

  1. Select Data > Get Data > From Other Sources > From Web.
  2. Paste the full file URL.
  3. Click OK.
  4. When prompted for authentication, select Organizational account.
  5. Click Sign in and choose the account with access to the file.
  6. Once signed in, click Connect.

3. Open the data in Power Query

Excel displays a preview of the file’s contents. Click Transform Data to open Power Query Editor and work with the imported data.

Excel displaying a CSV data preview with Load and Transform Data options

My example uses a CSV file. The approach is not limited to CSV: the direct URL provides access to the file, while the file type determines how Power Query interprets its contents.

Choose the Connection That Matches the Task

The trick to working with SharePoint and Power Query is matching the connector to the information you need:

  • A list: Use a SharePoint list connector with the site URL, then select the list.
  • A folder of files: Use the SharePoint Folder connector with the site URL, then filter by Folder Path.
  • Folder navigation: Use SharePoint.Contents to drill through libraries and folders, especially when a site-wide file listing is slow.
  • One file: Copy its full direct path and use From Web.

Once that distinction is clear, the different URL formats and connector choices become much easier to manage.

Build Your Power Query Skills Further

Inside our Excel Academy, Power Query Pro takes you from the basics through powerful transformations. Demystifying M explains how to read and write the code behind Power Query, including transformations that are not available in the interface.

We also have Power Query Quick Steps, our library of custom functions for tricky transformations. Insert them into a workbook and call them like normal functions, without having to build every solution from scratch.

Share

Excel Off The Grid

I help you reduce repetitive Excel work with practical guides to formulas, Power Query, reporting, and automation.

© 2026 Excel Off The Grid
Powered by Convella