none
Get the name of a month - PowerPivot v2

    Question

  • Hi,

    I need to determine the month name as a calculated column into a Time table with a date field as the pk of the table.

    I've used this formula: FORMAT(MONTH([Data]);"mmm")

    but unsuccessfully.

    Month names don't correspond with the month.

    Any suggests, please?

    Friday, March 22, 2013 4:55 PM

Answers

  • This one came up yesterday too. 

    To use a date format (like "MMM" for month name), you need to pass the function a proper date.  Not just an int for the month part.

    Try passing the full date (remove the MONTH() function).  And uppercase MMM is needed for month name abbreviated. 

    =FORMAT([Date],"MMM")

    Let me know if that helps.


    Brent Greenwood, MS, MCITP, CBIP // Please mark correct answers and helpful posts // http://brentgreenwood.blogspot.com

    • Marked as answer by pscorca Saturday, March 23, 2013 4:57 AM
    Friday, March 22, 2013 8:31 PM

All replies

  • This one came up yesterday too. 

    To use a date format (like "MMM" for month name), you need to pass the function a proper date.  Not just an int for the month part.

    Try passing the full date (remove the MONTH() function).  And uppercase MMM is needed for month name abbreviated. 

    =FORMAT([Date],"MMM")

    Let me know if that helps.


    Brent Greenwood, MS, MCITP, CBIP // Please mark correct answers and helpful posts // http://brentgreenwood.blogspot.com

    • Marked as answer by pscorca Saturday, March 23, 2013 4:57 AM
    Friday, March 22, 2013 8:31 PM
  • Ok, Brent, it functions. Many thanks.

    I've read this blog: http://daxtips.wordpress.com/2012/01/18/get-month-name-from-a-date-field/

    So I think it was wrong.

    Bye

    Saturday, March 23, 2013 4:57 AM