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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ccarpent
Helper IV
Helper IV

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
ccarpent
Helper IV
Helper IV

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
ccarpent
Helper IV
Helper IV

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors