Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Jennie
Regular 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
v-piga-msft
Resident Rockstar
Resident Rockstar

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.
Greg_Deckler
Super User
Super User

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?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors