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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
littlepatos
Helper II
Helper II

Sort Line Chart Axis by Month Number from Date Table

I have data with dates from July 2020 through to July 2021 and I want to represent using a line chart. I have created a Date table with Month number 1 for June and linked to data. I am using Sort By Month Number but it shows incorrectly with June 2021 before September 2020.

littlepatos_0-1681609074223.png

Do I need to factor in Years with Month Number or is there a way for PowerBi to do this?

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @littlepatos ,

Power BI does not add the year to the month automatically, I'm also not sure, if you are using two columns on the x-axis or if it's one column.

If it's two columns just switch the order of the year/month column as I did in the following line chart:
image.png

If it's one column you have to create your own order.

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
littlepatos
Helper II
Helper II

 my mistake- it does display as I need when I use the expand button 

littlepatos_0-1681612346293.png

Thanks @TomMartens much appreciated

littlepatos
Helper II
Helper II

 using 2 columns, Month & Year but when I swithc them it only shows Year and then I need to expand to show Month. I want to be able to display Month & Year if possible?

littlepatos_0-1681612142463.png

 

TomMartens
Super User
Super User

Hey @littlepatos ,

Power BI does not add the year to the month automatically, I'm also not sure, if you are using two columns on the x-axis or if it's one column.

If it's two columns just switch the order of the year/month column as I did in the following line chart:
image.png

If it's one column you have to create your own order.

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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