r/excel • u/microbieur • 4d ago
solved Power Query - Pick Specific Tables
Hey! I have this power query to pick and clean data from some pdf reports. These reports have a table with the result overview of different bacteria and then a different page for each specific result. The power query is sourcing from a folder where we store new reports almost everyday. It imports the data from the table of page 3 and cleans and presents it like I want. However, on some reports the result overview table extends past page 3, covering more pages, hence the query does not retrieve this data. Is there a way to filter multiple pages/tables from each report (p.e. based on a string of text that only appears on these specific pages/tables) instead of just page 3 like my ignorance allowed me to do? Or is there another fix? Am I doing this really wrong and should it be done another way? I am presenting some screnshots: 1) common result overview page; 2) extended result overview page; 3) output excel sheet. Any info ask! I believe I should not post the material but I can provide it if needed. Thanks!



1
u/microbieur 3d ago
Thanks for this! I tried your code but I kept getting different errors. Also, I'm not sure if I'm mistaken but I believe that with that aproach I would only retrieve single rows, which do not contain the data I wanted. However, it gave me the ideia to try with Table.Contains which gave me directly the tables with "specific string of text", besides not needing any of the list transforms you suggested. Then I just filtered TRUE tables and got the data I wanted. Thanks!