Forum Discussion
ana_cordeiro
7 years agoRegular Visitor
Replace Number by text
Hello, I'm replace the Numbers os one Month column by Text (replane 1 by January, 2 by February...). When I try replace 10 by October, 11 by November and 12 by December, appear attachment err...
- 7 years ago
Hi ana_cordeiro ,
To create a custom column as below.
Date.MonthName(#datetime(2011, [monthno], 1, 5, 0, 0), "en-US")
M code for your reference.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSBEyagkkzMGkOJi3ApCWYNDSAUBDdhkDtsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [monthno = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"monthno", Int64.Type}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Date.MonthName(#datetime(2011, [monthno], 1, 5, 0, 0), "en-US")) in #"Added Custom"
Ahmedx
Super User
3 years agoanother option
Date.ToText(#date(2022, [MonthNumber], 1), "MMMM", " en-US")