Skip to main content

Power BI

Needs Votes

Flexible handling of CSV source column count

Vote (4) Share
Lutz Bendlin's profile image

Lutz Bendlin on 18 Jul 2018 21:51:58

The current csv connector requires knowledge of the number of columns.

Source = Csv.Document(Web.Contents("somefile.csv"),[Delimiter=",", Columns=105, Encoding=1252, QuoteStyle=QuoteStyle.Csv]),

In our business process the number of columns changes over time, with new columns being added, others being removed. The connector is oblivious to that, so if the file now has 110 columns the connector would still just import the first 105 columns.

Request is to have a "Columns=auto" option that would adjust to the source file changes dynamically.

Comments (1)
Lutz Bendlin's profile image Profile Picture

Lutz on 05 Jul 2020 23:24:46

RE: Flexible handling of CSV source column count

You can ignore this. A simple fix is to NOT specify the number of columns. Like

Source = Csv.Document(Web.Contents("somefile.csv"),[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.Csv]),