Forum Discussion
Dont get the start done - transform multiple pdf from a file
Hey guys
So I watched some tutorials and read some Microsoft answer how to start with the data import via PQ.
When I selcted the file which contains the pdf´s, I click on transform, followed by clicking the down pointing double arrow at the first colum "content" to get to the combine window.
Now I got the problem, that the suggested "Tables" dont fit the way I need different text passages to be extracted.
I got the option to choose the complete pdf with "Page001" - but what to do then?
How can I select the passages I need?
The main project I want to clear is, to get a self refreshing diagram, based on the "everytime a file is created" synchronisation from onedrive. Maybe someone can share some light here please, thanks a lot.
Hi _V_ ,
Please share more details about the issue, as it might help in resolving it accurately.
Thank You.
21 Replies
- jaineshpMemorable Member
Hi _V_ ,
You're on the right track. After expanding "Content" and seeing "Page001", you'll need to use text functions to extract specific passages:
- Use Text.BetweenDelimiters() or Text.Range() to pull specific sections
- Try Text.Contains() to find the sections you need first
- Consider using "Extract Text" instead of "Tables" when combining if your PDFs have consistent formatting
For auto-refresh: Once extraction works, set up scheduled refresh in Power BI/Excel and your OneDrive sync should handle the file updates automatically.
What specific text sections are you trying to extract?That would help suggest the right text functions to use.
Best Regards,
Jainesh Poojara | Power BI Developer- _V_Helper I
Hey Jainesh
Thanks for the fast and competent support. Ill give it a try after I answered you.
The task is following:
We got a weigh bridge at our recycling yard at another location.
The weighing process creates pdf obviously.
I synced that folder to my colleagues and myself, to stay uptodate about stuff happening there.These pdf contain ( among other things as you can imagine ) the material type, the net weight and if material was delivered into or taken out.
With those informations I want to create a diagram that shows the current amount of asphalt or concrete has been dropped for example; or how many tons of our recycled gravel have been taken out.
So basically I need:
Delivery type - material type - net weight
Is this somewhat understandable? ^^
Id attach an example pdf, but it looks like I can only attach images or link the pdf.
Hers a preview, mostly german and a bit edited regarding personal data, but youll surelly understand it anyways.
- jaineshpMemorable Member
Hey _V_ ,
Perfect! I can see exactly what you need from the weigh slip. Looking at your Zimmermann Recycling document, I can identify the key fields:
Target Data Points:
- Material Type: "Bauschutt" (from the material description area)
- Net Weight: "6.47 t" (Netto field)
- Delivery Type: You'll need to determine this from context - likely from customer vs. internal codes or specific material descriptions
Extraction Strategy: Since this is a structured document, here's the approach:
- After expanding Content → Page001, use these Power Query functions:
Text.BetweenDelimiters([Page001], "Material:", "Netto") // for material type
Text.BetweenDelimiters([Page001], "Netto", "t") // for weight - For Delivery Type detection, you might need:
if Text.Contains([Material], "Bauschutt") then "Delivered"
else if Text.Contains([Material], "Recycling") then "Picked up" - Clean the data with Text.Trim() and Text.Replace() to remove extra spaces/characters
The German text actually helps - terms like "Bauschutt", "Beton", "Asphalt" are consistent identifiers you can use for classification.
Best Regards,
Jainesh Poojara | Power BI Developer- _V_Helper I
Jainesh,
I know what youre talking about, but I really dont get it done since Im completely new to this.
The problem with the delivery type is a field above; its either "ab Werk" which means taken of or its "Anlieferung" which would be "brought to us". Anyways, I guess this could be resolved later with the diagram, since we do not offer the materials we take for sale. So a materialtype can only be on or the other.
Ive taken some pics to show you my nooby moves, could you please have a look again?
I really appreciate your time and efforts.
After choosing the folder, I hit transform dataThen I use the double arrow next to contentand now I have to approch the filters?Then I choose the page, since it has all informations
- jaineshpMemorable Member
Hey _V_ ,
Looking at your screenshots, you're on the right track! Here are the next steps to clean up your data:
After selecting Page001:
- Remove unwanted columns - Right-click on columns you don't need (like the empty ones) and select "Remove"
- Promote headers - Your first row likely contains column names. Go to Transform tab → "Use First Row as Headers"
- Filter out nulls/blanks - Click the dropdown arrow on each important column and uncheck blank/null values
- Handle the delivery type issue - Since "ab Werk" materials aren't for sale, you can:
- Filter out those rows now, OR
- Keep them and handle it later in your data model
- Check data types - Make sure date columns show as dates, numbers as numbers, etc. Power Query usually auto-detects but double-check
- Close & Apply when your data looks clean
Quick tip: Don't worry about the delivery type complexity now - you can always add a calculated column later to mark sellable vs non-sellable materials.
Your approach is correct, just need these cleanup steps before loading the data!
Best Regards,
Jainesh Poojara | Power BI Developer
- V-yubandi-msftCommunity Support
Hi _V_ ,
If your issue is resolved, that’s good to hear. But if you're still facing any difficulties or running into new challenges, feel free to let me know.
Thank You.
- _V_Helper I
- V-yubandi-msftCommunity Support
Hi _V_ ,
Thank you for your response. Sorry to hear you’re still encountering errors. Could you provide a bit more information about the issue? For instance.
1. Does the error occur at a specific step? Or
2. Does it appear after you paste the M code?
With these details, I can troubleshoot more effectively or update the logic if needed.
Thank you for your patience let me know so I can assist further.
Regards,
Yugandhar.
- V-yubandi-msftCommunity Support
Hi _V_ ,
We haven’t received a response from you in some time. To help address the issue, could you share some sample data when possible?
Thank you.