Forum Discussion
enterprise gateway refresh error
- Anonymous10 years ago
Hello -
I was tinkering around and remembered that Power BI sometimes has problems with .csv files. The formatting gets all messed up and it works better designating your .csv file as a text file and letting the query dilimit the columns at each occurence of the comma.
I changed the query to handle the files in the designated folder as text files and the error dropped. Data is successfully refreshing with manual triggers. Have a scheduled trigger in 5 minutes to see if that works, can't see why it wouldn't.
thanks for reading.
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.