Forum Discussion
Nicolas
9 years agoFrequent Visitor
FORMAT() returns Month Number
Hi I'm trying to convert Month numbers (1,2,3...12) in text (January, February,...). I tried : =FORMAT(MONTH([MyColumn]), "mmmm") Anyway i could return some text? Thanks!
- 9 years ago
Hi Nicolas,
You can get the month name by using the DAX below.
MonthName = FORMAT(DATE(2016,Table1[MonthNumber],1),"MMMM")OR
Month Name = SWITCH(Table1[MonthNumber],1,"January",2,"February",3,"March",4,"April",5,"May",6,"June",7,"July",8,"August",9,"September",10,"October",11,"November",12,"December")
Regards,
Nicolas
9 years agoFrequent Visitor
Thanks but it now returns only January...
Is there not another way of doing the same thing?
Thanks!
Anonymous
9 years agoNot applicable
Oh yeah, the MONTH() argument shouldn't be there at all. FORMAT works on the entire date value.
FORMAT(TableName[Date], "MMMM")
- trebgatte9 years agoMost Valuable Professional
Try FORMAT(TableName[Date], "MMM") for the three letter month name as well.