Forum Discussion

joshtech's avatar
joshtech
Regular Visitor
2 years ago
Solved

How to sort Legend months according to calendar sequence sorting? Starts from Jan and end Dec

Hi Community,

In Clustered Column Chart, is there anyway to sort months according to calendar sequence? i.e. Starts from Jan and ends with December?
Even when I sort according to Month, or according to Descending or Ascending orders, it doesn't get sorted according to Calendar.

 

Please provide me with any youtube tutorials on how to create a separate calendar table if possible.

I tried this tutorial, but it seems a bit difficult. https://www.youtube.com/watch?v=-li7sxUxEqA&t=40s&pp=ygUkaG93IHRvIGNyZWF0ZSBhIGNhbGVuZGFyIGluIHBvd2VyIGJp

 

Thank you.

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi joshtech 

     

    Based on your needs, I have created the following table.

     

    You can use the following dax to merge two columns:

    Column = [Year] &"-"&LEFT([Month],3)


    Then change the format of the new column to "yyyy-mm".

     

     

    Then add a new column to the visual's X-axis to sort it:

     

     

     

     

    Best Regards,

    Jayleny

     

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

     

     

     

     

6 Replies

      • aduguid's avatar
        aduguid
        Icon for Memorable Member rankMemorable Member

        It looks like you may need to add another column for month number. Here's how to do it in power query. 

         

        = Date.MonthNameToNumber([MonthName])

         

    • joshtech's avatar
      joshtech
      Regular Visitor

      Hi Aduguid,

       

      The month is stored as text.

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi joshtech 

     

    Based on your needs, I have created the following table.

     

    You can use the following dax to merge two columns:

    Column = [Year] &"-"&LEFT([Month],3)


    Then change the format of the new column to "yyyy-mm".

     

     

    Then add a new column to the visual's X-axis to sort it:

     

     

     

     

    Best Regards,

    Jayleny

     

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