cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nicolas Frequent Visitor
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
Moderator v-caliao-msft
Moderator

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

7 REPLIES 7
KHorseman Super Contributor
Super Contributor

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
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!

Highlighted
KHorseman Super Contributor
Super Contributor

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!
trebgatte Member
Member

Re: FORMAT() returns Month Number

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

Moderator v-caliao-msft
Moderator

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

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 38 members 1,006 guests
Please welcome our newest community members: