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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
manoj_0911
Helper IV
Helper IV

Month Sorting Issue in Power BI Chart (MonthYear Format)

Hi everyone,

I'm encountering an issue with the sorting order of months in a Power BI chart. I'm using the following formula to display the month and year on the X-axis:

```
MonthYear = FORMAT('AGENT_SUBHOUR_V'[IXN_SUBHOUR_DATE], "MMM-YYYY")
```

The chart displays the months in this order:

* Sep-2023
* Oct-2023
* Nov-2023
* May-2023
* Jun-2023
* Jul-2023
* Jan-2024

However, I'd like the months to be sorted chronologically (Jan-Dec).

I've attached screenshots of the chart and the current sorting behavior for reference.

**Can anyone advise on how to ensure the months are sorted correctly based on their actual date value (chronological order)?**

manoj_0911_0-1711631850374.pngmanoj_0911_1-1711631857791.png

 

Any insights or suggestions would be greatly appreciated!

1 ACCEPTED SOLUTION
v-yaningy-msft
Community Support
Community Support

Hi, @manoj_0911 

Have you tried @jgeddes 's suggestion, in Column tools you can use Sort by column to sort the x-axis, the most efficient way to do this is to add an index column to the table.

vyaningymsft_0-1711678904403.pngvyaningymsft_1-1711678934906.png


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
v-yaningy-msft
Community Support
Community Support

Hi, @manoj_0911 

Have you tried @jgeddes 's suggestion, in Column tools you can use Sort by column to sort the x-axis, the most efficient way to do this is to add an index column to the table.

vyaningymsft_0-1711678904403.pngvyaningymsft_1-1711678934906.png


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

jgeddes
Super User
Super User

In the 'Column tools' ribbon there is a 'Sort by column' button that you can use to assign a new column to sort the existing column by. This only works if there is a distinct value in the new column. 

jgeddes_0-1711632388498.png

Depending on your data it may be better to create a date dimension table with all of the columns you need and then relate it back to your data table.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.