Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Csv.Document(), error on earch row.

Hi

 

Ref. Csv.Document()

 

Using Excel's powerquery and I am getting this message for each row in my CSV table.  I am using 'Csv.Document([content])'. I am pointing or using a folder as my source; the idea being we drop the CSV file in here and I haved asked powerquery to filter the latest version.  I just tried this on 1 file and same result.

 

 

This is what I see, if I click in the area in Green, I get the table above or preview bottom of the screen.  If I click on actual word 'Table'; in the screen print its is underlien sin yellow, I get the whole tabel with errors - see screen below.

 

 

Screen print table showing errors:

 

This is my some sample data, I opened the Excel CSV file in notepad to make sure it was text or no formating as such:

Period, Year, Job Code, Cost Centre, Account, Activity, Payroll Number, Description,   Amount
"7", "2019", "JOBCODE1", "123456", "2222",  "ACTIV01", "PAY01", "1111 DR. A B PERSON", "1.01",
"7", "2019", "JOBCODE2", "223456", "3332",  "ACTIV35", "PAY02", "1111 MR. B PERSON",  "1.02",
"7", "2019", "JOBCODE3", "323456", "4444",  "ACTIV01", "PAY99", "1111 MS. E PERSON",  "1.05"

 

Any thoughts, has anyone elese had this issue?

 

Chris C

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi

     

    Apology, I found this artcile "https://community.powerbi.com/t5/Desktop/The-Csv-Document-parameter-Columns-is-invalid/td-p/28742", but afterwards I now realsie what needed to be changed.  

     

    "Csv.Document([Content],[Delimiter=",", Columns=9, Encoding=1252, QuoteStyle=QuoteStyle.None])"

     

    So in my version I added a custom column, and i orginally used '=Csv.Document([Content])'.  Aftre reading the article above I changed this to read 'Csv.Document([Content],[Delimiter=",", Columns=9, Encoding=1252, QuoteStyle=QuoteStyle.None])'  and it now can see the rows or actual data.  What I noticed was, when I looked at the actual excel files on there own, ie a did a separte test or import Excel added an extra column at the end.  So intead of 9 columns powerquery throught there were 10.  I will close this Message off sorry, hopefullt this will help some one with the same issues.

     

    Many thanks

    Chris

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi

     

    Apology, I found this artcile "https://community.powerbi.com/t5/Desktop/The-Csv-Document-parameter-Columns-is-invalid/td-p/28742", but afterwards I now realsie what needed to be changed.  

     

    "Csv.Document([Content],[Delimiter=",", Columns=9, Encoding=1252, QuoteStyle=QuoteStyle.None])"

     

    So in my version I added a custom column, and i orginally used '=Csv.Document([Content])'.  Aftre reading the article above I changed this to read 'Csv.Document([Content],[Delimiter=",", Columns=9, Encoding=1252, QuoteStyle=QuoteStyle.None])'  and it now can see the rows or actual data.  What I noticed was, when I looked at the actual excel files on there own, ie a did a separte test or import Excel added an extra column at the end.  So intead of 9 columns powerquery throught there were 10.  I will close this Message off sorry, hopefullt this will help some one with the same issues.

     

    Many thanks

    Chris