One Query, Many Files: Connecting SharePoint Excel Data with Power Query


 If you’ve ever found yourself juggling multiple Excel files stored in SharePoint—monthly reports, regional trackers, or department‑specific spreadsheets—you know how painful it can be to keep everything in sync. Copying and pasting data works… until it doesn’t. File names change, columns shift, someone uploads a new version, and suddenly your perfectly crafted workbook is broken.

This is where Power Query quietly becomes one of the most powerful tools in Excel—and when combined with SharePoint, it unlocks a clean, scalable way to connect to multiple spreadsheets without manual effort.

Let’s walk through how it works, why it matters, and how to use it effectively.


Why Connecting to SharePoint with Power Query Matters

Power Query isn’t just an import tool—it’s a repeatable process. When you connect Excel directly to SharePoint, you’re no longer working with static files. You’re building a live connection that can refresh as files change, new data appears, or additional spreadsheets are added.

This approach is especially powerful when:

  • Files live in a shared SharePoint library
  • Data is updated regularly by multiple people
  • You want one “source of truth” for reporting or analysis
  • Manual consolidation has become unmanageable

Instead of re‑importing or re‑copying data every month, you refresh the query and let Excel do the hard work for you.


The Core Idea: Connect Once, Navigate Many

At the heart of this method is a simple idea:
Connect to the SharePoint site once, then navigate through its contents to get the files you need.

Rather than connecting to individual file URLs (which tend to break), you connect at the site level using Power Query’s SharePoint.Contents connector.


Step‑by‑Step: Connecting to SharePoint Files Using a Blank Query

Here’s the exact approach I use.

 

1. Open Power Query Editor

In Excel:

  • Go to Data
  • Select Get Data
  • Choose From Other Sources
  • Click Blank Query

This gives you a clean slate.

 

 

2. Open the Advanced Editor

  • In Power Query Editor, select Advanced Editor
  • You’ll see a basic query with a Source = ... line

This is the part we’ll replace.


3. Replace the Source Line with a SharePoint Connection

Replace the existing Source= line with the following (adjusting the site URL to match your environment):

 

Source = SharePoint.Contents("https://contoso.sharepoint.com/sites/finance", [ApiVersion = 15])

A few important notes:

  • Use the site URL, not the document library URL
  • ApiVersion = 15 ensures compatibility and better file navigation
  • This creates a structured table showing everything in that SharePoint site

Click Done.

 

 

4. Navigate Through the SharePoint Table

You’ll now see a table that represents your SharePoint site contents.

From here:

  • Filter down to Document Libraries
  • Drill into the library you need
  • Navigate folder by folder until you reach the file

This works for both:

  • XLSX files
  • CSV files

Once you select the file, Power Query handles it just like any other Excel data source.


5. Load, Transform, and Repeat

At this point, you can:

  • Transform the data (remove columns, rename headers, change data types)
  • Duplicate the query to connect to additional files
  • Or combine multiple files into a single dataset

When the underlying SharePoint files change, all you need is a Refresh.

 


 

Real‑World Scenarios Where This Shines

1. Monthly Files with the Same Structure

Finance teams often store monthly Excel files in a SharePoint folder:

  • January.xlsx
  • February.xlsx
  • March.xlsx

With Power Query, you can point to the folder and automatically combine them—no manual effort every month.

Tip: Use consistent column names across files to avoid transformation issues.


2. Department or Region‑Specific Spreadsheets

Each department uploads their own tracker to the same library. Power Query can pull them together into one reporting table.

Tip: Add the file name as a column so you always know where each row came from.

 

3. CSV Drops from Automated Systems

Many systems export CSVs to SharePoint on a schedule. Power Query can connect once and refresh forever.

Tip: If filenames change, filter by file extension or folder path instead of name.


4. Power BI Prep Before the Dashboard

Even if the data ends up in Power BI, Power Query in Excel is a great place to prototype and validate transformations before you scale.

Tip: Keep your transformations simple and well‑named so they’re easy to recreate later.

 

Tips and Tricks for Long‑Term Success

  • Avoid direct file URLs whenever possible. Site‑level connections are more resilient.
  • Rename queries clearly (for example, “Finance – Actuals” instead of “Query1”).
  • Document your steps in the query comments—future you will thank you.
  • Test refreshes after new files are added to ensure your logic still holds.

Wrapping It All Up

Connecting multiple Excel spreadsheets stored in SharePoint through Power Query is one of those techniques that feels small at first—but quickly changes how you work. It replaces fragile manual processes with something stable, repeatable, and refreshable. Once you’ve set it up, your spreadsheet stops being a snapshot in time and starts behaving like a system.

By using a blank query and a site‑level SharePoint.Contents connection, you gain flexibility, durability, and control over how your data flows into Excel. Whether you’re consolidating monthly reports, tracking departmental data, or preparing information for dashboards, this approach scales with you instead of fighting you.

If you’re already using Excel for serious work, Power Query plus SharePoint isn’t a “nice to have”—it’s a smarter way to build spreadsheets that last.