Forum Discussion

Mohsen_2020's avatar
Mohsen_2020
Icon for Helper III rankHelper III
6 years ago
Solved

Adding column to the data source but not visible after refresh

Dear Team, I added additional column to the data source which is CSV file uploaded to sharepoint but i can't find it added even after the refresh. Please advise, Regards, Mohsen 
  • Greg_Deckler's avatar
    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"