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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Line chart orderd by a month

I have a chart per month and over three years. When I want to order them so months appear from Jan to December, I am getting an error. How else can I fix it?

 

MaWrob_0-1732627696785.pngMaWrob_1-1732627720118.pngMaWrob_2-1732627746789.pngMaWrob_3-1732627763829.png

 

1 ACCEPTED SOLUTION
WishAskedSooner
Continued Contributor
Continued Contributor

There are a couple of ways to do this. One easy, the other complex.

 

From your screenshot, you are clearly using a column for the X-axis that Power BI interprets as text which is why Power BI sorts it alphabetically. This is likely because you created a calculated column from your Date column using the FORMAT() function which transforms the Date to text. This is not best practice (see the first option below).

 

The first option is to simply use a Date column of your table as the X-axis with the formatting set to however you want it displayed in the GUI. This will maintain the Date type and Power BI will then order by date versus alphabetically in your screenshot. I strongly encourage this solution before pursuing the next.

 

The second involves creating a sort column that matches the granularity precisely and sorting the column that Power BI is interpreting as text on the newly created sort column. This requires special care though because Power BI is buggy. Knowing how to do this however is important when one needs to custom sort actual text/labels.

View solution in original post

3 REPLIES 3
WishAskedSooner
Continued Contributor
Continued Contributor

Awesome! Glad to see you got it working. Unfortunately, this behavior is not well documented and nearly every new developer encounters it at some point, only to find themselves endlessly struggling especially because of the unresolved bugs (and I speak from experience).

WishAskedSooner
Continued Contributor
Continued Contributor

There are a couple of ways to do this. One easy, the other complex.

 

From your screenshot, you are clearly using a column for the X-axis that Power BI interprets as text which is why Power BI sorts it alphabetically. This is likely because you created a calculated column from your Date column using the FORMAT() function which transforms the Date to text. This is not best practice (see the first option below).

 

The first option is to simply use a Date column of your table as the X-axis with the formatting set to however you want it displayed in the GUI. This will maintain the Date type and Power BI will then order by date versus alphabetically in your screenshot. I strongly encourage this solution before pursuing the next.

 

The second involves creating a sort column that matches the granularity precisely and sorting the column that Power BI is interpreting as text on the newly created sort column. This requires special care though because Power BI is buggy. Knowing how to do this however is important when one needs to custom sort actual text/labels.

Anonymous
Not applicable

Thanks a lot - it worked!

MaWrob_0-1732629718557.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.