cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nicolas
Frequent 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!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Re: FORMAT() returns Month Number

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")

 

Capture.PNG

 

Regards,

View solution in original post

8 REPLIES 8
Super User I
Super User I

Re: FORMAT() returns Month Number

=FORMAT(MONTH([MyColumn]), "MMMM")

Capitalization counts. https://msdn.microsoft.com/en-us/library/ee634398.aspx


Did I answer your question? Please mark it as a solution.

Proud to be a Datanaut!
Nicolas
Frequent Visitor

Re: FORMAT() returns Month Number

Thanks but it now returns only January...

Is there not another way of doing the same thing?

Thanks!

Super User I
Super User I

Re: FORMAT() returns Month Number

Oh yeah, the MONTH() argument shouldn't be there at all. FORMAT works on the entire date value.

 

FORMAT(TableName[Date], "MMMM")


Did I answer your question? Please mark it as a solution.

Proud to be a Datanaut!

Re: FORMAT() returns Month Number

Try FORMAT(TableName[Date], "MMM") for the three letter month name as well.

Microsoft
Microsoft

Re: FORMAT() returns Month Number

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")

 

Capture.PNG

 

Regards,

View solution in original post

Seng
New Member

Re: FORMAT() returns Month Number

I created Year, Month and Day column and used MonthName = format(date('Calendar'[Year],'Calendar'[Month],'Calendar'[Day]), "mmmm") for the MonthName column.

alexander_korn1
Frequent Visitor

Re: FORMAT() returns Month Number

Hi @v-caliao-msft,

is there in a difference in terms of performance, with direct query in place?

Thanks in advance.

regards

Alex

Qwer1234
Regular Visitor

Re: FORMAT() returns Month Number

I am facing the same error as well. I am only getting January. Could anyone help?

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors