Forum Discussion
The Csv.Document parameter 'Columns' is invalid.
- 10 years ago
My IT department managed to fix the issue. We went through the advanced editor in query mode and manually changed the coding to get it to work.
This is how we did it:
This line of text is incorrect:
Imported CSV" = Csv.Document(#"Combined Binaries",[Delimiter=","columns=10, Encoding=1252]),
The columns=10 was counting the columns in the document (10 is correct) but something was going wrong. We deleted this text but lef tin the commas and republished the file. It then failed again due to this error:
The Csv.Document parameter 'QuoteStyle' is invalid. From memory the advanced editor text looked like this:
Imported CSV" = Csv.Document(#"Combined Binaries",[Delimiter=","columns=10, Encoding=1252]), QuoteStyle=QuoteStyle""
We deleted the QuoteStyle text and republished. The dashboard now refreshes using the automated refresh feature in Pro.
Thanks,
Giles
We found a solution by modifying the Csv.Document step as explained below. We encountered this same error in one of our solutions built in Power Query when a client updgraded from Excel 2013 to Excel 2016. The query was importing a CSV and was returning this error on the step that uses Csv.Document. It was and is still working correctly in Excel 2013, but was not working in Excel 2016.
The code that was returning the error was:
Csv.Document([Content],[Delimiter=",", Columns=40, Encoding=1252, QuoteStyle=QuoteStyle.None])
We changed it to the following:
Csv.Document([Content],[Delimiter=",", Column=40, Encoding=1252])
There were 2 changes, highlighted in red. Columns becomes Column (i.e. singular). This then no longer returns the parameter 'Columns' is invalid error message, but then returns an error message related to QuoteStyle. We then removed the QuoteStyle part. This then worked in Excel 2016. This code also works in Excel 2013 and in Power BI Desktop.
- Kelian9 years agoNew Member
Hi Lyndon,
Thank you for your return !
How the quotations of a .CSV can be ignore as the "QuoteStyle=QuoteStyle.None" no longer works ?
For instance if I have the following csv file :
First name, gender, address
John, male, "1 Fox Street"
And I use : Csv.Document([Content],[Delimiter=",", Column=3, Encoding=1252])
The result looks like:
First name | gender | adress |
John, male, "1 Fox Street"| | |
Without the quotation
First name, gender, address
John, male, 1 Fox Street
The result looks like:
First name | gender | adress |
John |male |1 Fox Street|
The quotations affect the result and there is no way to avoid them?
Best,
Kelian