cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jennie Frequent Visitor
Frequent Visitor

Need to apend data from folder, in case some files have column names in other language

I use data from a folder, where different users put data snapshot from a system during their shift. Some users login wih english, and some wih local language. Due to that in some files the same columns have name in local language. There around 4 columns with 2 possible versions of name. How can i make power query to apend the data from these colums using condition like "if column name is "date" or "дата" then appen it to date column"?
3 REPLIES 3
Super User
Super User

Re: Need to apend data from folder, in case some files have column names in other language

Remove your Promote Headers step, remove your 1st row and base everything around Column1, Column2, etc. and then at the end, rename these columns to their proper names?


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Community Support Team
Community Support Team

Re: Need to apend data from folder, in case some files have column names in other language

Hi @Jennie ,

Have you solved your problem with the suggestion of Greg_Deckler ?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please share some data sample which could reproduce your scenario and your desired output so that we could help further on it.

Best  Regards,
Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Jennie Frequent Visitor
Frequent Visitor

Re: Need to apend data from folder, in case some files have column names in other language

hello, I went through the steps,which were created automatically during connection and expanding the tables and I could not find the moment when the headers have been added. the first step after expanding the table already has headers. Below I have copied the M text. I do not know M, it was created automatically, but maybe it could help to understand what I have done.2019-08-06 20_34_07-Admiral reports - Power Query Editor.png2019-08-06 20_35_16-Admiral reports - Power Query Editor.png

 

let
    Source = Folder.Files("R:\Materials\External warehouse\Адмирал\WH backup morning stock"),
    #"Removed Other Columns" = Table.SelectColumns(Source,{"Content", "Name"}),
    #"Extracted Text Before Delimiter" = Table.TransformColumns(#"Removed Other Columns", {{"Name", each Text.BeforeDelimiter(_, ".xls"), type text}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Extracted Text Before Delimiter",{{"Name", type date}}),
    #"Filtered Hidden Files1" = Table.SelectRows(#"Changed Type", each [Attributes]?[Hidden]? <> true),
    #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File from WH backup morning stock", each #"Transform File from WH backup morning stock"([Content])),
    #"Removed Columns" = Table.RemoveColumns(#"Invoke Custom Function1",{"Content"}),
    #"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Columns", "Transform File from WH backup morning stock", Table.ColumnNames(#"Transform File from WH backup morning stock"(#"Sample File (2)"))),
    #"Renamed Columns" = Table.RenameColumns(#"Expanded Table Column1",{{"Name", "date"}}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Renamed Columns",{{"Материал", type text}, {"Описание материала", type text}, {"Batch", type text}, {"Storage Type", type text}, {"Storage Bin", type text}, {"Storage Unit Type", type text}, {"Storage Unit", type text}, {"Stock Category", type text}, {"Завод", type text}, {"Available stock", type number}, {"Base Unit of Measure", type text}, {"Storage Location", type text}, {"SLED/BBD", type date}}),
    #"Renamed Columns1" = Table.RenameColumns(#"Changed Type2",{{"Base Unit of Measure", "UoM"}, {"Storage Unit Type", "Pal Type"}}),
    #"Inserted First Characters" = Table.AddColumn(#"Renamed Columns1", "Start3", each Text.Start([Описание материала], 3), type text),
    #"Added Conditional Column" = Table.AddColumn(#"Inserted First Characters", "material type", each if [Материал] = null then "load issue" else if Text.StartsWith([Материал], "5") then "Pack" else if Text.StartsWith([Материал], "9") then "Pack" else if Text.StartsWith([Материал], "3") then "Ingred" else if Text.StartsWith([Материал], "4") then "FG" else if [Start3] = "WRC" then "WRC" else if [Start3] = "CTD" then "WIP" else if Text.StartsWith([Start3], "TM") then "Trim" else if [Start3] = "SHT" then "WIP" else "Ingred"),
    #"Renamed Columns2" = Table.RenameColumns(#"Added Conditional Column",{{"Start3", "Type"}})
in
    #"Renamed Columns2"

 

--------------------

I have only 3 bilingual columns, which I would like Power Query to understand automatically as one column name:

Material = Материал

Material description = Описание Материала

Plant = Завод

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,728)