Forum Discussion

polaris3028's avatar
polaris3028
Helper III
8 years ago

Sort Graph by Month and Year

Hi All,

 

Help needed. Can I have this graph sorted to have (left to right), Jan 2018, Dec 2017, Nov 2017 so on...?

 

Thanks,

Paul

6 Replies

  • JordanJSA's avatar
    JordanJSA
    Frequent Visitor

    Hi Polaris,

     

    You could create a new column in your table in the query editor and input the order in which you wish to see the dates by creating an index e.g.
    Jan 2018 = 1
    Dec 2017 = 2
    Nov 2017 = 3

    Once you've done that then sort the graph via the index created. But i would advise creating the table oldest date to newest for ease of use. 

    • polaris3028's avatar
      polaris3028
      Helper III

      Hi Jordan,

       

      Actually, the X-axis I used in this graph is from a Date table using the combined fields of month and year.

       

       InsertCalendarMonth = Table.AddColumn(InsertMonthName, "MonthInCalendar", each (try(Text.Range([MonthName],0,3)) otherwise [MonthName]) & " " & Number.ToText([Year])),

       

      Can you walk me through on how I can create a new column with index as suggested above?

       

      Thanks

      • JordanJSA's avatar
        JordanJSA
        Frequent Visitor

        Hi Polaris, 

         

        Okay, what source did you upload the data from? Excel? 

         

         

    • juanahumada's avatar
      juanahumada
      Frequent Visitor

      good solution, I could solved the same problem thank to your comment.