Forum Discussion

Shawry's avatar
Shawry
Helper I
2 years ago
Solved

Order dates chronoligically by month

Hi, 

 

I'm facing an issue in the new year, where Jan 2024 is displaying prior to my 2023 months, when looking at the past 6 months worth of data. See below: 

 

 

The data is coming from the below table, where I'm using the AVG Overall Score for each month. I also have an Index column, to help sort the column by the Index. This was working fine up until recently, and I am sorting by Month Name from within my linked Date table. 

 

 

However, I'm getting the following error when trying to sort the Overall Score column by the Index column due to the same value being present multiple times within the Overall Score column. 

 

 

How do I overcome or solve this issue? 

 

Thanks

  • Shawry's avatar
    Shawry
    2 years ago

    Thanks, I managed to sort it by created a new column which concatenated Month + Year, rather than using MonthName by itself. Cheers 🙂 

7 Replies

  • Hi Shawry 
    About the first part of the question, according to the picture you have a descending sort order just try to change it to ascending :

    About the index problems you can't sort month - year by month order because both January has 1 as an index but 
    January 2020
    and January 2021 is not the same chronologically.
    please refer to my answer from the linked discussion for more details (include the pbix  with example)

    https://community.fabric.microsoft.com/t5/Desktop/sort-by-month-and-year/m-p/3620056#M1187145

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

    • Shawry's avatar
      Shawry
      Helper I

      Hi Ritaf1983 

       

      Thanks for your reply. 

       

      I have an Ascending sort order, based on Month Name. The 2023 months are dispalying fine, but Jan 2024 is not. I believe it has something to do with my Date table's Month Name column, being ordered based on the Month Number i.e. Jan = 1. 

       

       

      Thanks. 

  • Hi,

    In the Date Table, ensure that the month name column is sorted by the Month number column.  To your visual, drag Month name and Year from the Date table.

    • Shawry's avatar
      Shawry
      Helper I

      Hi Ashish_Mathur 

       

      Thanks for your reply. 

       

      I already have sorted the Month Name by Month Number, however, still experiencing the issue. January = 1, therefore, is displaying before following months. 

       

      Month Name and Year are also the fields I'm using. 

       

       

      So the issue seems to be that the Month Name is sorted by Month Number AND January = 1. Is there some sort of way to also sort by Year on top of this?

       

      Cheers.