Power Query: Transform Data from PDF (Import PDF Tables)

Import PDF Tables into Excel tutorial showing Power Query table extraction data cleaning and PDF records analysis
Bring PDF table data into Excel with this practical tutorial. Learn how to import tables from PDF files, select the correct table, load data into Excel, clean headers, fix formatting issues, and prepare extracted records for reporting or analysis. Ideal for Excel users, analysts, finance teams, admin staff, and professionals who regularly work with PDF reports and need a faster way to convert them into usable Excel data.

Bank statements, government reports, and supplier invoices all arrive as PDF files. Re-typing the numbers is slow. Copy-paste introduces errors. Power Query's PDF import feature extracts tables from these files directly into Excel — no manual retyping, no third-party software. It detects tables within PDF pages automatically. Available in Excel for Microsoft 365 on Windows, it loads detected tables as clean, structured data ready for transformation, analysis, and connection to Power Pivot. This guide covers the full import process, how to handle multi-page and multi-file PDFs, six real-world scenarios, and every common issue.

Digital vs Scanned PDF — Know Before You Import

Power Query only extracts text from digital PDFs — files created by software where text can be selected with a cursor. Scanned PDFs are images of physical documents. In a scanned PDF, text is not actually text — it is a photograph of text, and the Navigator pane appears empty when you try to import it. Checking which type you have before attempting import saves time. Open the PDF in any viewer and try to highlight a word with your cursor. If individual words select cleanly, it is a digital PDF. If the entire page selects as a single image block, it is a scanned PDF.

Converting scanned PDFs: Use Adobe Acrobat Pro (Tools > Scan & OCR > Recognise Text), the free Smallpdf.com online converter, or Microsoft Office Lens (mobile app) to convert scanned PDFs to searchable digital PDFs before importing into Power Query. The conversion quality depends on scan resolution — 300 DPI or higher produces the most reliable OCR results.

The PDF Import Workflow — Step by Step

The import process follows a consistent five-step pattern regardless of the PDF source. Steps 3 and 4 apply specifically when the data spans multiple pages or requires cleaning before use.

1.
Open Excel. Go to Data > Get Data > From File > From PDF. Navigate to the file and click Open.
2.
The Navigator pane opens listing all detected tables. Each table is labelled by page number — "Page001 Table001", "Page002 Table001", etc. Click each to preview the data and identify the correct table.
3.
For a single-page table: click Transform Data to open in Power Query editor. For multi-page data: hold Ctrl and click all relevant page entries before clicking Transform Data.
4.
In Power Query editor: promote Row 1 to headers if needed. Remove blank rows caused by page-break artefacts. Fix column data types. Remove footnote rows at the bottom.
5.
Click Close & Load to load cleaned data to a worksheet. Alternatively choose "Close & Load To" to load only to the Data Model.

Example 1: Bank Statement — Extract Transactions from a PDF

Most UK and European bank PDF statements are digital and extract reliably. After importing, the typical cleaning steps are: promote Row 1 to headers (the statement may not put the header row first), change the Date column to Date type, change the Amount column to Currency type, and filter out blank rows caused by PDF page breaks. The cleaned query refreshes automatically when you save a new statement to the same file path and click Refresh, making monthly reconciliation a one-click operation.

Cleaning steps for a bank statement import: Source: Navigator > select the transactions table Step 1: Transform > Use First Row as Headers Step 2: Select Date column > Transform > Data Type > Date Step 3: Select Amount column > Transform > Data Type > Currency Step 4: Home > Remove Rows > Remove Blank Rows Step 5: If page-break rows remain: filter Date column where Date is not null Result: clean table with Date, Description, Amount columns ready for pivot, Power Pivot relationship, or chart source

Example 2: Multi-Page Report — Combining Tables Across Pages

When a single data table spans multiple PDF pages, Power Query splits it into one query per page in the Navigator. To reassemble the full table, Ctrl+click all relevant page table entries in the Navigator, load them to Power Query editor, and append them using Home > Append Queries. After appending, remove any duplicate header rows that appear mid-table — these are caused by the repeated column header row that some PDF generators include at the top of each page.

Combining multi-page PDF tables: In Navigator: Ctrl+click Page001 Table001, Page002 Table001, Page003 Table001 Click Transform Data. In Power Query editor: Step 1: Home > Append Queries > Append as New Select all page queries → OK Step 2: Remove duplicate header rows: Filter where [Date] column does not equal "Date" (these are repeated header rows from the top of each PDF page) Step 3: Fix data types and clean as normal

Example 3: Government Statistical Data — Clean Multi-Row Headers and Footnotes

Government statistical publications contain multiple formatted tables in a single PDF. ONS, HMRC, and similar bodies publish economic data as PDF reports with complex layouts — multi-row headers, footnotes, and merged cells. Power Query can extract any table from these files. The common cleaning challenges are multi-row headers at the top of the table, footnote rows at the bottom, and merged category cells in the left column that show the value only in the first row and leave subsequent rows blank.

Cleaning government report PDF tables: Issue 1 — Multi-row headers (e.g. 3 header rows): Home > Remove Top Rows > enter 2 (to keep row 3 as the header) Transform > Use First Row as Headers Issue 2 — Footnote rows at the bottom: Home > Remove Bottom Rows > enter the number of footnote rows Issue 3 — Merged cells (category repeated in left column): Select the left column > Transform > Fill Down (fills the category name down through all blank cells in the group) Issue 4 — Numbers stored as text with comma thousands separators: Custom Column: = Number.From(Text.Replace([Amount], ",", ""))

Example 4: Batch Import — Combine Multiple PDF Files from a Folder

When you receive monthly PDF statements in a folder, combining them automatically with Power Query eliminates the need to import each file individually. Use Data > From Folder to read all PDFs in the folder. Then create a custom function from a single sample file's query and apply it to each file's binary content. This approach processes all 12 monthly statements in a single query that refreshes automatically when new files arrive in the folder — a fully automated PDF data pipeline requiring no manual intervention each month.

Folder-based PDF batch import: Step 1: Build the transform query for one sample PDF file. Apply all cleaning steps (promote headers, fix types, remove blanks). Name this query "SampleFileTransform". Step 2: Right-click "SampleFileTransform" > Create Function. Name the function "TransformPDFFile". Power Query wraps the steps into a function accepting a binary file as input. Step 3: New query > Data > Get Data > From File > From Folder. Navigate to the folder containing all monthly PDF statements. Step 4: Add Custom Column: = TransformPDFFile([Content]) Step 5: Expand the resulting column to combine all table rows into one query.

Example 5: Irregular PDF Layouts — Handle Inconsistent Column Structure

Not every PDF table has clean column alignment. Supplier invoices often have narrative description text in a wide column alongside narrow numeric columns. Power Query may split content into more columns than expected, or merge columns that should be separate. Use Table.SelectColumns to keep only the needed columns, and Text.AfterDelimiter or Text.Between to reshape mixed-content columns into the structure you need. Two or three custom column transformations are usually sufficient to clean even significantly irregular layouts.

Fixing irregular column splits: Extra columns from wide PDF cells: Add Column > Choose Columns > select only the columns you need Description split across two columns: Select both columns > Transform > Merge Columns > Separator: space Amount and currency code combined in one cell ("GBP 1,234.56"): Custom Column: = Number.From(Text.AfterDelimiter([Amount], " ")) Date and time in same cell ("15/01/2025 09:32"): Custom Column: = DateTime.Date(DateTime.FromText([DateTimeCol]))

Example 6: Dynamic File Path — Parameter-Driven PDF Source

Hard-coding a file path in the query source step breaks the query when you move the file or run it on a different machine. Power Query parameters solve this. Create a text parameter for the folder path and a second parameter for the filename. Reference both parameters in the source step. Subsequently, updating either parameter value redirects the query to the new location without editing any M code — simply change the parameter values in Manage Parameters and click Refresh.

Dynamic file path with parameters: Step 1: Home > Manage Parameters > New Parameter Name: FolderPath | Type: Text | Value: "C:\Statements" Step 2: New Parameter Name: FileName | Type: Text | Value: "March2025.pdf" Step 3: In the query source step, combine parameters: = File.Contents(FolderPath & FileName) To switch months: change FileName parameter value only. To move the folder: change FolderPath parameter value only. Both changes apply to all queries that reference these parameters.

Troubleshooting PDF Import

Both issues below are the most common problems users encounter. The first — an empty Navigator — is by far the most frequent and has a definitive diagnosis step that confirms the cause immediately.

The Navigator pane is empty after selecting the PDF

An empty Navigator almost always means the PDF is scanned rather than digital. Open the PDF in any viewer and try to select text with your cursor. If you cannot select individual words, it is a scanned image. Use Adobe Acrobat Pro's OCR feature (Tools > Scan & OCR > Recognise Text), or a free online tool like Smallpdf, to convert it to a searchable digital PDF. Import the converted file into Power Query. A genuinely empty PDF — with no tables on any page — also produces an empty Navigator, though this is much less common.

The extracted table has incorrect column splits or missing data

Column splitting issues occur when the PDF table has inconsistent column alignment — common with proportional fonts and hand-assembled layouts. Power Query detects column boundaries from character position patterns, which breaks when content wraps across visual columns. Specifically, use Table.SelectColumns to keep only the columns you need, discarding any spurious split columns. Then use Table.CombineColumns or a custom column formula to reshape content back into the correct structure.

The PDF import option is missing from the Get Data menu

PDF import is only available in Excel for Microsoft 365 on Windows — it is not available in Excel 2019, Excel 2021 standalone, or Excel for Mac. If the option is missing from Data > Get Data > From File, confirm that Excel is a Microsoft 365 subscription version, not a perpetual licence. Additionally, verify that the Excel installation is fully up to date — the PDF connector was added in a 2020 update and may be absent in installations that have not received recent updates.

Frequently Asked Questions

  • How do I import a PDF table into Excel using Power Query?+
    Go to Data > Get Data > From File > From PDF. Select your PDF file and click Open. The Navigator pane opens showing all detected tables labelled by page. Click a table to preview it. Click Transform Data to clean it in Power Query editor, or Load to send it directly to a worksheet. This feature requires Excel for Microsoft 365 on Windows. It is not available in Excel 2019 standalone, Excel 2021 standalone, or Excel for Mac.
  • Why does the Navigator show no tables when I import my PDF?+
    An empty Navigator almost always means the PDF is scanned rather than digital. Open the PDF and try selecting text with your cursor — if individual words highlight cleanly, it is a digital PDF. If the entire page selects as one block, it is a scanned image. Power Query can only extract text from digital PDFs. Convert scanned PDFs to digital format using Adobe Acrobat Pro's OCR feature or a free online converter like Smallpdf before attempting import. The converted file typically imports cleanly.
  • Can Power Query combine tables from multiple pages of the same PDF?+
    Yes. In the Navigator, use Ctrl+click to select tables from each page simultaneously. Click Transform Data to open all of them in Power Query editor. Use Home > Append Queries to combine them into a single continuous table. After appending, add a filter step to remove duplicate header rows — these appear when the PDF generator repeats column headers at the top of each page. Filter the first column where it does not equal the header text to remove them cleanly.
  • Does the PDF import refresh automatically when the source file changes?+
    Yes. After the query is created, clicking Data > Refresh All re-runs the import from the same file path. If you replace the source PDF with an updated version at the same path and same filename, clicking Refresh imports the new data automatically. For monthly files with changing filenames, use a Power Query parameter for the filename and update the parameter value each month before refreshing. The parameter approach means only one value needs to change to redirect the entire query to the new month's file.