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

How to get months in correct order ?

I applied this dax to get a new month column from date : FORMAT(Table[calendar_date],"MMM")
But I'm getting following result:

shivam_1-1659902224965.png

Now how can I get this month column in actual order of months?

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

@Anonymous 
Ok I think you just want to oder them. Create a new a month number column (if you don't already have it) whcih is MONTH (Table[calendar_date])

Then use the option "Sortb By Column" to sort the Month column by the Month Number column

View solution in original post

9 REPLIES 9
tamerj1
Super User
Super User

@Anonymous 
Ok I think you just want to oder them. Create a new a month number column (if you don't already have it) whcih is MONTH (Table[calendar_date])

Then use the option "Sortb By Column" to sort the Month column by the Month Number column

Anonymous
Not applicable

Reverting FORMAT(DATE (1, MONTH (Table[calendar_date]), 1), "MMM") to FORMAT(Table[calendar_date],"MMM") and then sorting by Month Name by Month No. worked.

 

Thank you @tamerj1 as always

Anonymous
Not applicable

I created new month no. column but on sorting month name by month no. it is showing this

shivam_1-1659905927108.png

 

@Anonymous 

Please share a screenshot of the table

Anonymous
Not applicable

it is not allowing the sort because FORMAT(DATE (1, MONTH (Table[calendar_date]), 1), "MMM") gave "Dec" even for null values, so now "Dec" has month no. as 12 and null (since month no. has null for null date)

Anonymous
Not applicable

shivam_0-1659906546264.pngshivam_1-1659906573324.png

can only share this much with you 😞

 

 

tamerj1
Super User
Super User

Hi @Anonymous 

please use

FORMAT(DATE (1, MONTH (Table[calendar_date]), 1), "MMM")

Anonymous
Not applicable

Hi @tamerj1 ,
it doesn't change anything, still getting the same result

@Anonymous 
YOu are creating a calculated column right. Please share a screenshot to the result you got from the table itself not from the visual.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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