Power Query Problems

How to Import Excel Files from ZIP Archives into Power BI

Elise WilliamsElise Williams Oct 10, 2026 869 views

Question details

The user needs to connect to and extract data from Excel files that are compressed inside ZIP archives directly within Power BI or Power Query.

How to Import Excel Files from ZIP Archives into Power BI
Product
Power BI / Power Query
Device & OS
not provided
Scenario
Connecting Power Query to a SharePoint folder or local directory to combine tables from multiple Excel files stored inside ZIP archives.
Observed behavior
Power Query connects to the folder and retrieves the ZIP files as binaries but cannot natively expand their contents without specialized ZIP extraction logic.
Before you start

Ensure you have the exact SharePoint URL or local folder path containing your ZIP archives, and verify that the internal Excel files share a consistent table structure for appending.

Solution 1Recommended

Use Custom Power Query Extraction Logic

This is the standard approach for handling ZIP binaries directly inside Power Query by invoking a custom M function to enumerate and extract the internal Excel files.

Power Query does not feature a native one-click unzip button. Instead, you must load the ZIP files as binary data and apply custom M code to decompress the archives on the fly.

Note that processing large or numerous ZIP files dynamically during data refresh can be resource-intensive and may increase load times.

1
Connect to the SharePoint folder

Open Power BI Desktop, click on 'Get Data', select 'SharePoint folder', and enter your site URL. Click 'Transform Data' to load the file list into the Power Query Editor.

2
Filter for ZIP archives

Click the filter dropdown on the 'Extension' column and select '.zip' to ensure you are only processing your compressed archives.

3
Apply custom extraction function

Create a new Blank Query and paste a trusted custom M function for ZIP extraction (often provided in Power BI community forums). In your main query, go to 'Add Column' > 'Invoke Custom Function' to decompress the 'Content' binary column.

4
Expand and combine Excel tables

Once the function extracts the internal files, filter the new column for '.xlsx' files. Click the double-arrow expand icon to unpack the tables, then append files with matching structures.

Use Custom Power Query Extraction Logic
Power BI Community Guidance: For the exact custom M code needed to extract ZIP binaries, refer to the 'Working with ZIP Files in Power Query' article on the Microsoft Fabric community blog.
Free Microsoft Office alternative

Prepare Your Excel Datasets Seamlessly with WPS Office

While Power BI and Power Query are essential for advanced data modeling, preparing your raw Excel data before importing is equally crucial. WPS Office offers a free, lightweight spreadsheet editor that handles heavy Excel datasets with ease, providing seamless compatibility with Microsoft formats.

  1. 1. Download and Install: Download WPS Office from the official website and install it on your device in seconds.
  2. 2. Open Your Datasets: Double-click your raw Excel or CSV files to open them directly in WPS Spreadsheet for preliminary review and formatting.
  3. 3. Clean and Save: Remove blank rows, standardize naming conventions, and save as a standard .xlsx file before archiving it for Power BI ingestion.
100% compatibility with Microsoft Excel formats (.xlsx, .xls, .csv)Free and lightweight suite for fast, localized data cleaningFamiliar user interface requiring zero learning curveAdvanced formula support and batch processing capabilities
microsoft office alternative - wps office

Frequently Asked Questions

Can Power Query natively unzip files without custom code?

No, Power Query does not currently feature a native one-click extraction tool for ZIP files. You must use a custom M function or external tools to parse and decompress ZIP binaries.

How do I handle password-protected ZIP files in Power BI?

Power Query cannot decrypt or decompress password-protected ZIP files natively. You must remove the password protection or extract the files using a secure script or third-party tool before importing the data into Power BI.

Why does my data refresh take so long when using ZIP files?

Decompressing archives on the fly consumes significant CPU and memory resources during the Power Query execution phase. For large data volumes, it is highly recommended to pre-extract the files using Power Automate or a batch script.

What if my ZIP archive contains multiple different file types?

After expanding the initial ZIP binary using your custom function, you will see a list of the extracted files. You can simply filter the 'Extension' column to include only '.xlsx' or '.csv' before expanding the data tables.