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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
LFPernambuco
New Member

PDF from Folder Multiple Tables and Multiple Pages

HI I have the following scenario and questions:

1. Folder with Multiple PDF Files to Import

2. Each PDF File has multiple Tables --> I tried to select more than 1 table - No Success

3. Each PDF File can have 1 to Several Pages --> Need to consolidate all pages with data into 1 table

 

I'm new to Power Query, so, If someone can guide me step by step, really appreciate

 

Thanks

Lucia

1 ACCEPTED SOLUTION
Anonymous
Not applicable

PDFs can be tough to work with. I try to use the same basic strategy every time I use them. I always keep the PageNumber column, sorted ascending, and then add an index column.

Then, in order to get all of your columns, and so the column values remain in the correct positions, you have to sort the tables in the table column by greatest to least count of columns:

 

= Table.AddColumn(NameOfPriorStep, "ColumnCount", each Table.ColumnCount([TableColumn]))

 

Then, sort the ColumnCount column  in descending order. In your case, you could also filter out any tables with 0 columns at this point.

Next, I duplicate this query, and filter to just the Table values ( as opposed to the Page values). Then I filter to just pages in the original query.

Only now do I expand the table column. The very next step is to sort again, this time on your index column. Now, you have all of your columns, all in the correct positions (sometimes, some special characters will cause you trouble, like bullet points), and your pages are in the right order. 

I promise you, if you take these initial steps anytime you work with PDFs in Power Query, your remaining work will be much, much easier!

 

--Nate

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

PDFs can be tough to work with. I try to use the same basic strategy every time I use them. I always keep the PageNumber column, sorted ascending, and then add an index column.

Then, in order to get all of your columns, and so the column values remain in the correct positions, you have to sort the tables in the table column by greatest to least count of columns:

 

= Table.AddColumn(NameOfPriorStep, "ColumnCount", each Table.ColumnCount([TableColumn]))

 

Then, sort the ColumnCount column  in descending order. In your case, you could also filter out any tables with 0 columns at this point.

Next, I duplicate this query, and filter to just the Table values ( as opposed to the Page values). Then I filter to just pages in the original query.

Only now do I expand the table column. The very next step is to sort again, this time on your index column. Now, you have all of your columns, all in the correct positions (sometimes, some special characters will cause you trouble, like bullet points), and your pages are in the right order. 

I promise you, if you take these initial steps anytime you work with PDFs in Power Query, your remaining work will be much, much easier!

 

--Nate

Hi watkinnc, could you please suggest any suitable videos for the above explanation if availble. Thank you 

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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