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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
thedogspollocks
New Member

Combining multiple tables from one PDF / columns not aligning despite being identically formatted

Hi all,

 

I'm currently using the following formula to combine a table across multiple pages:

 

= let Source = Pdf.Tables(File.Contents("C:\DIRECTORY\FILENAME.pdf"), [StartPage=24, EndPage=29])in Source

 

This produces the following, misaligned results:

 

thedogspollocks_0-1678474936539.png

 

Is there a way to correct this, or would I need, perhaps, to make some edits to the PDF.. which I can do, but it would be perhaps more time consuming. 

 

Here is the formatting of the table from which the above data is derived:

thedogspollocks_1-1678475256182.png

Thanks for any help. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Any time you are combining PDFs, you need to get the column count while the tables are still collapsed, like Table.AddColumn(PriorStepOrTableName, "Columns", each Table.ColumnCount([TableColumnName]))

 

Then sort descending by column count, and only then should you expand the tables.

Anyway, the automatic column splitting is not perfect. Also, keep one of your original columns when you expand the table column--so you can put the expanded tables back in the right order if your PDF data has no sort data.

 

--Nate

View solution in original post

2 REPLIES 2
Ehren
Microsoft Employee
Microsoft Employee

If you can share an anonymized/sanitized sample file, we can look into why the columns on each page are not recognized as being aligned.

Anonymous
Not applicable

Any time you are combining PDFs, you need to get the column count while the tables are still collapsed, like Table.AddColumn(PriorStepOrTableName, "Columns", each Table.ColumnCount([TableColumnName]))

 

Then sort descending by column count, and only then should you expand the tables.

Anyway, the automatic column splitting is not perfect. Also, keep one of your original columns when you expand the table column--so you can put the expanded tables back in the right order if your PDF data has no sort data.

 

--Nate

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors