Forum Discussion
Can't refresh data. Error message "The Csv.Document parameter 'Columns' is invalid."
- Anonymous10 years ago
Fixed it.
This may not be the solution for everyone with this error message, but what worked for me was upgading to the Power BI Entrerprise Gateway and configuring the data refresh through that.
I had eliminated all other potential causes, so deleting the Personal Gateway and installing/configuring Enterprise was my last troubleshoot.
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.