Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 error.
Can help me?
Solved! Go to Solution.
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"
another option
Date.ToText(#date(2022, [MonthNumber], 1), "MMMM", " en-US")
Hi Ahmedx,
Your suggested code works for me. Thank you so much!
And thanks for the very quick response too.
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"
Hi @ana_cordeiro ,
Its quite unknown which formula you are using to map month number with month name. I suggest you to use the SWITCH expression to accomplish your requirement.
Hi, I copied in the string of code, but there is error in the code. Can someone help?
Hello,
Could you please share some sample data & the expression you have written to get the required text?
This will give anyone who wants to help you to get more insight & guide you further.
Thanks!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |