Forum Discussion

Pratima's avatar
Pratima
Advocate II
9 years ago
Solved

Month Name in sorting order

Hi All,

 

I want Month Name to displayed like in ascending or descending order not like this

 

 

 

 

 

 

Thanks,

Pratima

  • Go to the database tab, select month name column from your calendar table.  Select the modeling tab and then "Sort by Column" and select your month number column.  Month name should now appear in the correct order.

17 Replies

  • tjd's avatar
    tjd
    Impactful Individual

    Go to the database tab, select month name column from your calendar table.  Select the modeling tab and then "Sort by Column" and select your month number column.  Month name should now appear in the correct order.

    • Pratima's avatar
      Pratima
      Advocate II

      Thank you Tjd for the valuable answers.....

       

      Now i am getting the expected result

       

       

      Thanks,

      Pratima

       

      • matthewtmitchel's avatar
        matthewtmitchel
        Frequent Visitor

        I am running Power BI Desktop version 2.51.4885.701 and do not have a Database tab.  I have Home, View, Modeling, and Help.  Do you mean the Modeling tab?  If not, is there a different way to sort in numerical month order, instead of alphabetical month order?

    • dave2ta's avatar
      dave2ta
      Regular Visitor

      Awesome, thank you for that... I would have wasted a lot of time on this...

       

      Dave

  • theov's avatar
    theov
    Advocate III

    Hi, you can sort month name by month number (sort by another column possibility). 

    If you have multiple years, you should create a year month column combining year and month and sort this column. To sort the latter you need to create a new column too basically amplifying the importance of year by multiplying to like 100 and adding month number:

     

    Here is a video explaining it thoroughly:

    https://www.youtube.com/watch?v=Oq5WOmo94_Q

  • Hello, 

     

    This works when I have 12 months of data. But in case I have 24 months of data I get the sorting order as 

     

    Apr-20,Apr-21,May-20,May-21. 

     

    Can you please help with sorting 24 months' data appropriately?