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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.