Forum Discussion

Nihed's avatar
Nihed
Helper III
4 years ago
Solved

Last month

Hello,

I have date table, then I create a new column call Month Name using 

Month Name = FORMAT('Date'[Date],"MMMM")

And I have Month Number for sorting this month name become a proper sorting.

It returns September. How can I make it return December? Since the max of the month is December.I want to return it always the biggest month name based on sorting on the Month Number

 

Thnak you.

  • Hi Nihed ,

    If the Month Number column is of text type, the September will be the largest as you described.

    Change the Month Number data type to Whole number, it will be sorted numerically from smallest to largest.

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

     

     

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Nihed 
    can you try this measure?
    Max Month = CALCULATE( Month Name, Month Number = MAX(Month Number))

    • Nihed's avatar
      Nihed
      Helper III

      what do you mean by Month Name lease?

      • amitchandak's avatar
        amitchandak
        Super User

        Nihed . I think Aditya Suggested the month name column you created

         

        a measure Like

        maxx(filter(all(Date), Date[Month Number] = max(Date[Month Number])), Date[Month Name])

  • Hi Nihed ,

    If the Month Number column is of text type, the September will be the largest as you described.

    Change the Month Number data type to Whole number, it will be sorted numerically from smallest to largest.

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.