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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

How to match my column with another table to trasnalte

helpThe title can be confusing, i have 2 tables, 1 is transaltion 

English

French

German

Dutch

Product stability

Stabilité du produit

Produktstabilität

Productstabiliteit

Product UI

Porduit UI

Produkt UI

Gebruikersgemak

Missing features

Caractéristiques manquantes

Fehlende Merkmale

Nieuwe functionaliteit

Technical Support

Support technique

Technische Unterstützung

Technische support

Implementation Services

Services de mise en oevre

Implementierungsdienste

Implementatie

Other

Autres

Andere

Iets ander



the otehr table is my feedback which has 1 column only called mutiple choice

pbiguru123_0-1713522956563.png



how can i create a new calumn called transalted answers to see if the multiple answer matches with english column, then keep the same else if multiple answer matches with french, then return english equivilent else if multiple answer matches with dutch, then return english equivilent else if multiple answer matches with german, then return english equivilent




1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

let
    translation = translation_table,
    multiple_choice = multiple_choice_table,
    dict = Record.FromList(
        List.Repeat(translation[English],4),
        List.Combine(Table.ToColumns(translation))
    ),
    translated = Table.AddColumn(
        multiple_choice, 
        "translated answers", 
        each Record.FieldOrDefault(
            dict, 
            _[Multiple choice] ?? "", 
            _[Multiple choice]
        )
    )
in
    translated

View solution in original post

2 REPLIES 2
dufoq3
Super User
Super User

Hi @Anonymous, different approach.

 

Result:

dufoq3_0-1713538819412.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VY9BDoJADEWv0rD2EkZYsJAY0BVhUYcCjTDItGOiN/IO7riYZFiIXfw0r7/9aVlGUbUro5Mba28UCsUr96zPQI8swrYFgIZQvSMJOMiZTGdZTEew1sUqOdH5oy9v2+BJh3tPA1llcguTmsmK0v8MlUcLBbkHm20AZjHlSWgP6NDo/HYsypMngQHt5HFJ3Cz0pAL7LE7y30s3hUu6nqsbrKWJquoL", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Multiple_choice_1__c = _t]),
    TranslationTable = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VVBBTsMwEPzKKud+okIC9VBAKj1VObjOtFklcdLddRG8hwt/4NaPYSdpobfdmfHMrHe74lX6KnojNbfnlu2jWBSbeb58UxVpyAq2hI/axq7Sy9cN9DcQSVku/ny3q6zpJVvMy+QyLU/YS+QGokd0rhmfrlmVw5EOcBYFmmQPTpxPfYTV+BSh1Llwii7YSD+ibhEq0BrSdK5Fwp4Z8R10iMEb98H96/YGXwf2rqVNHIZe8hnzRDZyKSJhk059DdqmJFG7/NhnDMd7TmeTbL3qhhYdgrkcShvImf3Y8TpSqtmxghCox1ly0O0VQ5K9VoygdsckP4wJL1ZDErOMNv3NMh0+urQwJZe3oix/AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [English = _t, French = _t, German = _t, Dutch = _t]),
    TranslationList = Table.ToList(TranslationTable, Combiner.CombineTextByDelimiter("||")),
    Ad_EnglishTranslation = Table.AddColumn(Source, "English Translation", each 
        [ a = Text.Combine(List.RemoveMatchingItems(Text.Split(Text.Trim([Multiple_choice_1__c]), " "), {null, "", " "}), " "),
          b = List.Select(TranslationList, (x)=> Text.Contains(x, a, Comparer.OrdinalIgnoreCase)),
          c = if b = {} then "**MISSING IN TRANSLATION**" else if Text.Length(a) = 0 then null else Text.BeforeDelimiter(b{0}?, "||")
        ][c], type text)
in
    Ad_EnglishTranslation

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

AlienSx
Super User
Super User

let
    translation = translation_table,
    multiple_choice = multiple_choice_table,
    dict = Record.FromList(
        List.Repeat(translation[English],4),
        List.Combine(Table.ToColumns(translation))
    ),
    translated = Table.AddColumn(
        multiple_choice, 
        "translated answers", 
        each Record.FieldOrDefault(
            dict, 
            _[Multiple choice] ?? "", 
            _[Multiple choice]
        )
    )
in
    translated

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.