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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
NewbieYR
Frequent Visitor

Covert date to MMM and sort by date

I got a maybe silly question...

I have converted the Month to MMM format (because it looks better on the visual), appearently it changed the data type to Text and now it's sorting by Alphbatically order with Apr as the first column in my visual.

Is there a way to change the sorting order back to date while using the MMM format on visual?

 

Thank you!!

2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

Hi @NewbieYR ,

 

A text column can be custom sorted by another column

To create a month sort column in DAX, you may use MONTH(Table[Date]).

In Power Query, go to Add Columns tab, highlight the dates column, go to Date then Month. This will create a column of month number where January is 1 and December is 12.  

danextian_0-1659399645672.png

 

More info on custom column sort - https://radacad.com/sort-a-column-with-a-custom-order-in-power-bi

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

MahyarTF
Memorable Member
Memorable Member

Hi,

If you have Month as a number in your column list, you could sort the particular column MMM based on the number month column.

Add the below code to create a new column in the table as a month number :

'Monthnumber = "Month",MONTH([Date table])'

then in your table click on the month column (MMM), then go to the menu and select 'Sort by Column' and in the drop-down menu, select 'Monthnumber' column :

MahyarTF_0-1659413914394.png

then Short name of the month is sorted based on the number of month

Mahyartf

View solution in original post

2 REPLIES 2
MahyarTF
Memorable Member
Memorable Member

Hi,

If you have Month as a number in your column list, you could sort the particular column MMM based on the number month column.

Add the below code to create a new column in the table as a month number :

'Monthnumber = "Month",MONTH([Date table])'

then in your table click on the month column (MMM), then go to the menu and select 'Sort by Column' and in the drop-down menu, select 'Monthnumber' column :

MahyarTF_0-1659413914394.png

then Short name of the month is sorted based on the number of month

Mahyartf
danextian
Super User
Super User

Hi @NewbieYR ,

 

A text column can be custom sorted by another column

To create a month sort column in DAX, you may use MONTH(Table[Date]).

In Power Query, go to Add Columns tab, highlight the dates column, go to Date then Month. This will create a column of month number where January is 1 and December is 12.  

danextian_0-1659399645672.png

 

More info on custom column sort - https://radacad.com/sort-a-column-with-a-custom-order-in-power-bi

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors