Forum Discussion
Adding column to the data source but not visible after refresh
- 6 years ago
Mohsen_2020 - This is very common with CSV files. By default in the Source step, they specify the number of columns to import. So if you add one, it does not pick up this new column. You need to use Advanced Editor to edit the source step and remove or increase the number of columns.
let
Source = Csv.Document(File.Contents("C:\temp\powerbi\wagons.csv"),[Delimiter=",", Columns=10, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Consignment", type text}, {"Docket", type text}, {"Date Loaded", type datetime}, {"Depot", type text}, {"Wagon", type text}, {"Product", Int64.Type}, {"Gross", type number}, {"Tare", type number}, {"Net", type number}, {"Overcarry", type number}})
in
#"Changed Type"
Mohsen_2020 - This is very common with CSV files. By default in the Source step, they specify the number of columns to import. So if you add one, it does not pick up this new column. You need to use Advanced Editor to edit the source step and remove or increase the number of columns.
let
Source = Csv.Document(File.Contents("C:\temp\powerbi\wagons.csv"),[Delimiter=",", Columns=10, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Consignment", type text}, {"Docket", type text}, {"Date Loaded", type datetime}, {"Depot", type text}, {"Wagon", type text}, {"Product", Int64.Type}, {"Gross", type number}, {"Tare", type number}, {"Net", type number}, {"Overcarry", type number}})
in
#"Changed Type"