Forum Discussion
vishnugupta_
3 years agoNew 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"
Please suggest possible solutions!
3 Replies
- ValtteriNCommunity Champion
Hi,
Instead of referencing Monthnumber column you can reference your date column:
e.g.Month = FORMAT('Calendar'[Date],"mmm")
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/ - FreemanZSuper 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
- nchrFrequent 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.