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

Sorting by Year/Month and Display Month Name

Hello,

 

I am new to the community and have found a lot of good information, but nothing has solved the exact problem I am facing.

 

I've got a Matrix that I need to sort by month, but I need the most recent month to appear at the top of the list:

January

December

November

etc.

 

Obviously now that we're in the new year, I had to solve for January and December sorting to opposite ende of the Matrix, which I managed to solve for using the solution posted HERE. Unfortunately, this leaves me with rather unappealing month names:

202001

201912

201911

etc.

 

I would like to keep this sort (another method is welcome), but I would also like to display the Month name like in the example above.

 

I don't mind if the year is visible:

January 2020

December 2019

November 2019

etc.

but would prefer the month only.

 

Does anyone know how this might be possible?

Thanks in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

For Month - Year Like Jan-2020, Feb 2020 or January 2020, February 2020.

Create a new column

Sort Month Year = format(Date[date],"YYYYMM")

Now make it as the sort column for you Month-Year from model view

Sort_by_column.png

 

For only Month Column Create one more column

 

Sort Month = format(date[Date],"MM")

 

Use this as a sort column.

 

Most of the visuals sort on first measure or value. Change it to sort on month year.

 

Refer any of the pbix from my blogs give below, You will also find code

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -

https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

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

2 REPLIES 2
amitchandak
Super User
Super User

For Month - Year Like Jan-2020, Feb 2020 or January 2020, February 2020.

Create a new column

Sort Month Year = format(Date[date],"YYYYMM")

Now make it as the sort column for you Month-Year from model view

Sort_by_column.png

 

For only Month Column Create one more column

 

Sort Month = format(date[Date],"MM")

 

Use this as a sort column.

 

Most of the visuals sort on first measure or value. Change it to sort on month year.

 

Refer any of the pbix from my blogs give below, You will also find code

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -

https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

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

I've realized my mistake.

 

Amitchandak,

 

I'll mark your answer as a solution for such a speedy response! Though it is a similar solution to the link that I provided in my question, there really wasn't a problem with either solution--I was simply using the 'Sort by column' feature wrong.

 

In case anyone else stumbles across the same issue--you need to highlight the column that will be used in the Matrix (or other vizualization) and THEN use 'Sort by Column' to select which column you want your visible column to be sorted by.

 

I know--silly.. but I appreciate the help all the same!

 

SStange

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