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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
JUJU_628
Microsoft Employee
Microsoft Employee

How to get a short form of Month ( "Format" is no longer working on my end at least)

Hi all,

 

Anyone can help me with changing the Month into short form. For example, January to Jan.

I've beening reading quite a few answers which suggested using add column = Format([Month],”MMM”) 

But all I got is the error message saying :

"Expression.Error: The name 'format' wasn't recognized. Make sure it's spelled correctly."

 

Can anyone help me with that?

 

Thanks!

Julia

8 REPLIES 8
FarhanAhmed
Community Champion
Community Champion

If month contains month name like January , February etc. Then you can use by creating new column

 

Short Month = LEFT (Table[Month],3)

 







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




OwenAuger
Super User
Super User

Hi Julia,

 

If you're getting that error message, you must be creating the column in Power Query, which would be my preferred place to add columns where possible 🙂

Assuming that [Month] is of type date, you can add such a column using the expression:

 

=Date.ToText([Month], "MMM")

 

FORMAT is a DAX function, so you can only use it to create a calculated column after loading the data to the model and clicking "New column" on the ribbon or in the context-menu of a table in the Fields list.

 

Regards

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Ok, maybe too early for the success. Is that true if I add column in the field, it's not making any real change in the query? Because I need this column for adding another column.

If data is consistent in that column, it will not affect your current query







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




is that true we cant see it in the power query. In the end I'm able to add another column in the field but not the query.

Thank you Owen! Yes, you are right! Because I'm in that power query! I got out of that editor and tried in the field, the format is working! However, I think the format only works when it's date format, right? Mine is text.

amitchandak
Super User
Super User

@JUJU_628 , you need to give Date, seem like you are giving a text

 

Format([Date],”MMM”)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thank you! Yes, I realised the it's the text not the date.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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