Forum Discussion
Losing a column when importing PDF
I'm not sure about the PDF connector, but check out your M code in the Advanced editor. The first line for a CSV import though might look like this:
= Csv.Document(#"C:\Users\FileList txt",[Delimiter=":", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None])
It doesn't matter if that file gets a 3rd column added, it will always only read the first two. I remove that.
= Csv.Document(#"C:\Users\FileList txt",[Delimiter=":", Encoding=1252, QuoteStyle=QuoteStyle.None])
See if your PDF connection has that same setting.
- diego_martinezn4 years agoFrequent Visitor
Hi edhans , thanks for answering :).
For the PDF the code generated automatically is this:
= Pdf.Tables(File.Contents("C:\whatever direction i have the file"), [Implementation="1.3"])Any thoughts on how to solve the issue?
- edhans4 years agoCommunity Champion
Are all columns coming in, but your M code isn't handleing a 2 or 3 column table depending on the file? If so, check out this blog post. Removing/Selecting Columns - Pitfall #5 in #PowerBI and #PowerQuery - DataChant - particularly the MissingField.Ignore discussion.
- diego_martinezn4 years agoFrequent Visitor
Depending on the file (all have the same structure) it recognizes 2 or 3 tables.
When there are 2 tables there are no problems, but when it recognizes 3 there is a column that is not loaded I don't know why. It's not that I deleted it during transformation or something like that, it is missing from the beginning.