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! Learn more

Reply
Anonymous
Not applicable

Issue with Sorting Month-Year Order in the format of MMM-YY in the visuals

Hi PowerBians ,

 

I have developed a visual with MMM-YY month order and applied rolling 6 months logic .

But when it shows in visual looks weird that the sorting order not good as below :

dinesharivalaga_0-1689658008451.png

Here after Dec-22 , Jan-23 should come but the 2023 months orders are coming reverse .

When i sort by month again then the visual starts with Jan-23 until May-23 and then Dec-22 displaying like below..

dinesharivalaga_1-1689658109773.png

What should i do now to fix this ? Please help ..

 

BR

DK

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

 

You have to create column using DAX: 

Month-Year sort = FORMAT(Orders[Order Date],"YYYYMM")
 
and then sort by the Month-Year column by above created column
You can refer below link:

 

Mark my post as a solution, if this helps you  

Thanks

mlsx4
Memorable Member
Memorable Member

Hi @Anonymous 

 

There is a nice video explaining it: https://www.youtube.com/watch?v=yx-Duj_KPtw

TomMartens
Super User
Super User

Hey @Anonymous ,

 

you need to create an index column sorting your  MM-Year values. This is explained in this article: https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column?tabs=powerbi-desktop

For example YEAR*100+MonthNumber

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
Anonymous
Not applicable

@TomMartens @Anonymous @mlsx4  Thanks for your response ..

I already have a index column created in the table but still the order is missing ..

dinesharivalaga_0-1689921155647.png

from dashboard 2023 data is sorting fine :

dinesharivalaga_1-1689921206600.png

But 2022 year data is not .. how is it possible ? I tried to did sort axis options from the visual but still not sorting ..

dinesharivalaga_2-1689921273854.png

 

 

 

Hi @Anonymous 

 

Your index column does not take into account the year, therefore it won't work. You should do some trick to the index column (as in the video or as Tom's solution) to consider the year too.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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