Forum Discussion
Extract data from PDFS where data not uniform
There isn't really a way to loop through conditions, however, there are some ways around it.
The easiest built-in method is to use the folder connector - https://learn.microsoft.com/en-us/power-query/connectors/folder. You can try put all your PDFs in the same folder, and then transform one of them. Once you load it into your data, the transformation will be applied to all PDFs in the file. With this method, the same tranformations are applied to all files in the folder, so there's not a lot of flexibility.
Otherwise, there are ways to write functions in M - this will be a bit more involved coding-wise. I recommend checking out https://blog.crossjoin.co.uk/2016/05/15/creating-m-functions-from-parameterised-queries-in-power-bi/ and https://learn.microsoft.com/en-us/power-query/custom-function for more details.
Thank you, I will try