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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Pandadev
Post Prodigy
Post Prodigy

Importing Pdf Table from web url using Python , but it is not stored as dataframe in PowerBI

Hi I am trying to import a pdf table to PowerBI. from - https://www.caas.gov.sg/docs/default-source/pdf/singapore-registered-aircraft-engine-nos---apr-2020d...

I am new to both PowerBI and Python , but from research managed to get this code working

 

import tabula
file = "https://www.caas.gov.sg/docs/default-source/pdf/singapore-registered-aircraft-engine-nos---apr-2020d..."
tables = tabula.read_pdf(file, pages = "all", multiple_tables = True)

 

but for some reason it is not showing as a table in PowerBI , even though no errors are reported

1 ACCEPTED SOLUTION

Hi @Pandadev ,

 

You can use Python to get the table in PDF and export the table, and then select the appropriate connector in power Bi to connect the export file.

http://theautomatic.net/2019/05/24/3-ways-to-scrape-tables-from-pdfs-with-python/ 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Pandadev ,

 

why don't you use the Power BI PDF Connector?

 

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-connect-pdf

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Thanks , yes that works fine for this pdf , but when I import a pdf where I only want certain tables , how can I merge all those selected tables to one table. all the selected tables will have the same structure , column order etc.

Hi @Pandadev ,

 

Based on your description. You can get this PDF file using the web connector.

let
    Source = Pdf.Tables(Web.Contents("https://www.caas.gov.sg/docs/default-source/pdf/singapore-registered-aircraft-engine-nos---apr-2020d1324ca0a72f4d42bd40c25673b42c82.pdf-is-not/td-p/1121450"), [Implementation="1.1"]),
    Table001 = Source{[Id="Table001"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Table001, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"NO.", Int64.Type}, {"TYPE", type text}, {"REG", type text}, {"OPERATOR", type text}, {"ENGINE TYPE", type text}})
in
    #"Changed Type"

test_ger_pdf.PNG

Use append queries to append more tables.

append.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks , here is an example where I only need selected  tables from the pdf - http://inaca.or.id/wp-content/uploads/2019/07/CAR19.pdf

where the column headers are the same as below , is this possible indonesian column headers.JPG

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Pandadev ,

 

looks good, try it yourself 😉

 

PDFImport.png

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


is there a way to create just one table which has tables containing the correct columns , as the powerbi is pulling in lot's of tables that are not required. was wandering if i could say if the table contains the column headers then add it.

Hi @Pandadev ,

 

You can use Python to get the table in PDF and export the table, and then select the appropriate connector in power Bi to connect the export file.

http://theautomatic.net/2019/05/24/3-ways-to-scrape-tables-from-pdfs-with-python/ 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors