Forum Discussion
column dynamic language translation
- 5 years ago
Hi Anonymous ,
If you want to use DAX function to achieve it, you need to create a Table including different months from different regions, and a Germany month column like this:
Then you can create a calculated column in the source table to 'translate' the month column:
Germany month translation = IF ( 'Table'[Month] IN DISTINCT ( 'Month'[Germany month] ), [Month], LOOKUPVALUE ( 'Month'[Germany month], 'Month'[Month], 'Table'[Month] ) )Attached a sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
You can use lookup values in a Record to do the translation in Power Query. You could also use another table and do a join on the month name, but the lookup using a record I think would be easier.
let
Months = [
JANUARY = "Januar",
FEBRUARY = "Februar",
MARCH = "März",
APRIL = "April",
MAY = "Mai",
JUNE = "Juni",
JULY = "Juli",
AUGUST = "August",
SEPTEMBER = "September",
OCTOBER = "Oktober",
NOVEMBER = "November",
DECEMBER = "Dezember",
JANUARI = "Januar",
FEBRUARI = "Februar",
MAART = "März",
// APRIL
MEI = "Mai",
JUNI = "Juni",
JULI = "Juli",
AUGUSTUS = "August",
//SEPTEMBER
OKTOBER = "Oktober"
//NOVEMBER
//DECEMBER
],
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8irNS1WK1QExcirBDMfS9NLiEjAzOLWgJDU3KbUIoiIxrzSxKBPMdktNKoJzfBMTiyAaHAuKMnMgYqlAuVgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Month = _t]),
#"Added Custom" = Table.AddColumn(Source, "NewMonth", each Record.Field(Months, Text.Upper([Month])))
in
#"Added Custom"
Where a month has already been listed in another language, I've left a commented out line (Apr, Sep, Nov and Dec in Dutch).
I'm using Text.Upper([Month]) to ensure the match is case insensitive.
Regards
Phil