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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
vishnugupta_
New Member

FORMAT DAX FUNCTION not working as expected

Month = FORMAT('Calendar'[Month Number],"mmm")
 
This function is mapping month number 1 with "Dec" and all other month numbers (2-12) with "Jan"
 
vishnugupta__0-1676109207723.png

 

vishnugupta__1-1676109246665.png

 

Please suggest possible solutions!
3 REPLIES 3
nchr
Frequent Visitor

Hello, the first argument to FORMAT in your case is an integer representing a date. So, passing "1" actually means 12/31/1899 which is correctly formatted to just "Dec". When "2" is passed to the FORMAT function, it means 1/1/1900 which is correctly formatted to "Jan". 

 

So, the solution here is to pass the whole date to the FORMAT function, not just a part of it.

 

 

FreemanZ
Super User
Super User

hi @vishnugupta_ 

it seems you got data with different locale, or YYYY MM DD format. 

change it in Power Query

https://www.myonlinetraininghub.com/change-type-using-locale-with-power-query

 

 

ValtteriN
Super User
Super User

Hi,

Instead of referencing Monthnumber column you can reference your date column:

e.g. 

Month = FORMAT('Calendar'[Date],"mmm")

ValtteriN_0-1676112063597.png

 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/




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

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.