Forum Discussion

jmaikido's avatar
jmaikido
Microsoft Employee
5 years ago
Solved

Calendar sort for Line Chart display

Hi Listers, If I have a calendar column of format such as "mmm-yyyy" and want to display my values in a line chart, how do I sort the calendar for the line chart x-axis to display Jan 2020, Feb 2020...
  • edhans's avatar
    5 years ago

    You need to create another column, either in your source data or in Power Query, that would be the year * 100 + the month, so it would be 202001, 202002, 202003, etc. Then you would sort your axis column above by this column. Sort by column in Power BI Desktop - Power BI | Microsoft Docs has detailed info. My date table at https://bit.ly/DateTableByEd is built in Power Query and has several columns used exclusively for sorting other columns.

  • jmaikido's avatar
    jmaikido
    5 years ago

    Edhans, Thnx heaps 

    worked a treat

    Rgds