Forum Discussion
Anonymous
5 years agoNot applicable
CSV column format changed, How to adapt??
Hi I used combine function in power query to combine multiple CSV from sharepoint folder together. I used the sample file transformation - it was working like a charm untill recently - the company w...
Anonymous
5 years agoNot applicable
Looks like you know the column names that you want to include. Therefore, at very end of your import csv step, you can add the column names that you need, like:
Source= (...)[[ColumnName],[AnotherColumn],[YetAnotherColumn]]
This will give you a table of only the columns you ask for.
--Nate
Anonymous
5 years agoNot applicable
let
Source = SharePoint.Files("https://foodstuffs.sharepoint.com/sites/sc-TransportReporting/", [ApiVersion = 15]),
#"Filtered Rows" = Table.SelectRows(Source, each Text.Contains([Folder Path], "Driver Report/Data/OS")),
#"Filtered Hidden Files1" = Table.SelectRows(#"Filtered Rows", each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File"))),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"event_timestamp", type datetime}, {"display_name", type text}, {"rego_plate", type text}, {"cost_center", type text}, {"asset_code", type text}, {"driver_alias", type text}, {"driver", type text}, {"odometer", type number}, {"speed", Int64.Type}, {"spd_limit", Int64.Type}, {"spd_band", Int64.Type}, {"course", Int64.Type}, {"longitude", type number}, {"latitude", type number}, {"location", type text}})
in
#"Changed Type"Hi I am not too familiar with M language, could you better guide me on where along this auto generated code I should be specifying column names??
- v-kelly-msft5 years agoCommunity Support
Hi Anonymous ,
Check the similar thread below:
Best Regards,
KellyDid I answer your question? Mark my post as a solution!