Forum Discussion

ICW1972's avatar
ICW1972
Regular Visitor
2 years ago
Solved

How to sort date slicer by month name when already using SortOrder column

This one is an oldie but a goodie.  I've not found a solution to something that seems like it should be straightforward.  Lots of posts on how to do this but they are not working for me.

 

I have table that has some dates.  It's not a Calendar table, just some dates.

 

I have a SortOrder column that is sorted in the table and in the visualization.  

 

February 2024 should appear first, then January 2024, etc. The dates go back to July 2023.  I always end up with the axis sorted by Month Name.

 

What am I doing wrong?

 

 

 

5 Replies

  • Hello ICW1972 ,

     

    if you want to only sort the months in the slicer , then you click on the month column and sort by month number

    • ICW1972's avatar
      ICW1972
      Regular Visitor

      Not really.  If I have two July months (2023, 2024) that doesn't work.  That's why there is a SortOrder column to provide distinct values.


      I tried your suggestion anyway and it doesn't sort. 

      Thank you for replying though!

      • Idrissshatila's avatar
        Idrissshatila
        Icon for Super User rankSuper User

        ICW1972 ,

         

        So you need to have a year/month column as the following:

         

        year/month = format('YourTablename'[dateColumn],"mmm YYYY")

        year/month sort =  format('YourTablename'[dateColumn],"mmYYYY")

         

        and sort the year/ month column by the year/mont sort.