Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Solved! Go to Solution.
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
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.