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
Samruddhi_11
Helper I
Helper I

Sort by Month - Year

Hii,

 

Here is my Month-Year column,

 

Samruddhi_11_1-1633349428560.png

 

Currently, It is sorted by alphabetic order of month but I want by ascending order of year. For e.g, 

September2020, October2020, November2020, March2021, May2021 like this.

 

Please suggest me any idea on this. Thanks in advance!!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Samruddhi_11 

Change the date format to whole number will better you sort the Month – Year .

(1)Make sure the Month-Year column is in Date format . If not ,change it to Date format .

(2)Create a column to return the whole number format for the Month-Year column .

Year-Month = YEAR('Table'[Date])*100+'Table'[Date].[MonthNo]

(3)Create a column to return the Text format for the Month-Year column .

month year = FORMAT('Table'[Date],"MMMM") & YEAR('Table'[Date])

(4)Select the visual ,and Sort by Year-Month , then choose Sort ascending .

The final result is as shown :

Ailsamsft_0-1633575234171.png

I have attached my pbix file , you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Samruddhi_11
Helper I
Helper I

 

Thanks!

mahoneypat
Microsoft Employee
Microsoft Employee

Also consider using a "No Sort" Date table like shown here.  M and DAX code provided.

No Sort Date Tables! – Hoosier BI

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hi @Samruddhi_11 

Change the date format to whole number will better you sort the Month – Year .

(1)Make sure the Month-Year column is in Date format . If not ,change it to Date format .

(2)Create a column to return the whole number format for the Month-Year column .

Year-Month = YEAR('Table'[Date])*100+'Table'[Date].[MonthNo]

(3)Create a column to return the Text format for the Month-Year column .

month year = FORMAT('Table'[Date],"MMMM") & YEAR('Table'[Date])

(4)Select the visual ,and Sort by Year-Month , then choose Sort ascending .

The final result is as shown :

Ailsamsft_0-1633575234171.png

I have attached my pbix file , you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks! 

amitchandak
Super User
Super User

@Samruddhi_11 , Create a column like this in table and mark that as sort column

Month Year sort = FORMAT([Date],"yyyymm")

 

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

 

 

Sort Month Year.png

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

Hi @amitchandak , I am getting below error while I am doing sorting by Month -Year Sort column

Samruddhi_11_0-1633350674619.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.