Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RyanS32229
Frequent Visitor

Changing Month Number to Name - FORMAT not working

I'm trying to plot 2017 figures vs 2018's by month. This is working fine for Month Number on the X axis, using a calculated column simply as MONTH([Date]).

 

image.png

However I really want to see month name along the X axis. I tried using FORMAT(MONTH([Date]), "mmm") however it gives me this:

 

image.png

 

Seems to be converting the month number into 31st December 1899, 1st Jan 1900, 2nd Jan 1900 etc.

 

How can I get month names on the x axis?

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @RyanS32229,

 

Two ways to extract month name from a date field:

 

MonthName = 'Table Name'[Date].[Month]

 

Alternatively

MonthName = FORMAT('Table Name'[Date],"MMM")

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
ingdanielrayez
Regular Visitor

I have the same problem. Could you solve it?

v-yulgu-msft
Employee
Employee

Hi @RyanS32229,

 

Two ways to extract month name from a date field:

 

MonthName = 'Table Name'[Date].[Month]

 

Alternatively

MonthName = FORMAT('Table Name'[Date],"MMM")

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Floriankx
Solution Sage
Solution Sage

Hello I think your formula works fine.

 

You should sort MonthName by MonthNumber:

 

Please give it a try and let us know.

 

Best regards

See the 2nd pic, it's clearly not working.

 

Using the FORMAT is taking MONTH([Date]) as a Day Number rather than a Month Number, therefore it's formatting January i.e. (01) into 31st December 1899, February into 1st January 1900, March into 2nd January 1900 etc.

Hi @RyanS32229

 

Can you perhaps share your data set? It could be that your dates are in the wrong format, or the setting in Power BI is set to a different date format also.

 

If you can send a link to your pbix I can have a look.

 

Thanks

 

shebr

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.