Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
jmaikido
Microsoft Employee
Microsoft Employee

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 ...... Dec 2020 and then Jan 2020 etc?

TIA John

2 ACCEPTED SOLUTIONS
edhans
Super User
Super User

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.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

jmaikido
Microsoft Employee
Microsoft Employee

Edhans, Thnx heaps 

worked a treat

Rgds

View solution in original post

3 REPLIES 3
edhans
Super User
Super User

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.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
jmaikido
Microsoft Employee
Microsoft Employee

Edhans, Thnx heaps 

worked a treat

Rgds

Great @jmaikido - I hope you don't mind. I marked my answer as the solution so others that view this thread can quickly see how to get it to work.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.