Forum Discussion

160475's avatar
160475
Helper I
4 years ago
Solved

sorting months

dears    i have a chart where the dates are not sorted correctlly, the date data i have are in text form JAN-DEC  im trying to creat a new column with this DAX: Month number = month(tablename[Mont...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi 160475 ,

     

    There is a tip to convert Month name to Month number—— combine Month name and " 1" , then change its type to DateTime, finally use MONTH() to get the number:

     

    Month Number = MONTH( CONVERT( MAX('Table'[Month]) &" 1", DATETIME))

     

    In visuals , you could apply it to Tooltips field , and then sort by it:

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.