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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MonikaS
New Member

Line Chart - X-axis formatting

Hi,

I would need an advice please, when I put Months on the X-axis, they don't logically follow from January, through February, etc. to December (from left to right on the X-axis of the graph). How can I organize it?Power BI_Line Chart.JPG

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

First, you need an additional column in your date table to display the month number. You can either create this in Power Query beforehand or after loading your table with something similar to MonthNumber = CONCATENATE ( YEAR ( date[date] ), MONTH ( date[date] ) ). Then you can select your Month column and go to modeling options. There you can use sort by to sort your months by month number. Here is a blog post with more info on this:

https://radacad.com/sort-by-column-in-power-bi

View solution in original post

amitchandak
Super User
Super User

You have to create a sorting column in the table and use that as a sort column. The option is there when the view table in Data mode under the modeling tab.

 

You can use code to create a sort column from date

 

Sort of Month = format(date,"YYYYMM")

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @MonikaS ,

 

The month name is text type which is not suitable for sorting. You can use SWITCH() or FORMAT() function to get whole number type which is easier and more suitable for sorting.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

You have to create a sorting column in the table and use that as a sort column. The option is there when the view table in Data mode under the modeling tab.

 

You can use code to create a sort column from date

 

Sort of Month = format(date,"YYYYMM")

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

First, you need an additional column in your date table to display the month number. You can either create this in Power Query beforehand or after loading your table with something similar to MonthNumber = CONCATENATE ( YEAR ( date[date] ), MONTH ( date[date] ) ). Then you can select your Month column and go to modeling options. There you can use sort by to sort your months by month number. Here is a blog post with more info on this:

https://radacad.com/sort-by-column-in-power-bi

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors