Forum Discussion

vishnugupta_'s avatar
vishnugupta_
New Member
3 years ago

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

  • ValtteriN's avatar
    ValtteriN
    Community 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/
  • nchr's avatar
    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.