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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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.

 

error.PNG

 

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.

 

error2.PNG

 

Screen print table showing errors:

error3.PNG

 

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

1 ACCEPTED SOLUTION
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

View solution in original post

1 REPLY 1
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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.