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

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

Reply
Anonymous
Not applicable

Sorting Months

First time using a Date Table because I keep hearing I should. Unfortunately visuals are sorting Month names alphabetically. To try and get around that I have added the Month Number to my Date Table. Unfortunately even that is sorting alphabetically. How in the world can get the months to simply appear in the order in which they occur? 

 

Example of what is happening:

Apr, August, ...

Month #:

1, 10, 2, 3,...

 

Desired Result:
January, February..

 

Month#:
1, 2, 3...

 

Screenshots of the problems:

Brenden_1-1685033395573.png

 

 

Brenden_0-1685033367941.png

 

 

Here is the DAX I have used/modified trying to get the Date table to cooperate:

DateTable =

ADDCOLUMNS (

CALENDAR (DATE(2023,01,01), DATE(2023,12,31)),

"Year", YEAR ( [Date] ),

"Month", FORMAT ( [Date], "MMM" ),

"Month Number", FORMAT ( [Date], "M" ),

"Weeks",

"Week"&

VAR _WN = WEEKNUM([Date],1)

RETURN

IF(

_WN>52,

5,

IF(

MOD( _WN,4)=0,

4,

MOD( _WN,4)

)

),

"Days",FORMAT ( [Date], "DDDD" )

)



 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Anonymous 
After adding the month number, you need to modify the sort order of months names by these numbers:

Ritaf1983_0-1685033790227.png

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @Anonymous 
After adding the month number, you need to modify the sort order of months names by these numbers:

Ritaf1983_0-1685033790227.png

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors