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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
hmeltonPSL
Helper II
Helper II

Change Month number to name in DAX

I have a direct Query.  Using the formula below to create the Month in my date hierarchy.  I really need the Month Name but can't use Format in my function.  How do I get the name to appear and not the number but also sort correctly in the graph?
Month = Month('Reports_vwAllWorkOrders'[DATECOMPLETE])
 
Thank you!
 
hmeltonPSL_0-1760449285081.png

 

1 ACCEPTED SOLUTION
collinq
Super User
Super User

Hi @hmeltonPSL ,

Direct Query adds a challenge to this but the easiest way is probably to make two separate DAX columns.  

The first one is to create the Month Number like this:
MonthNumber = MONTH('Reports_vwAllWorkOrders'[DATECOMPLETE])

Then, you can use a "Switch" to change the number to words:
MonthName =
SWITCH(
MONTH('Reports_vwAllWorkOrders'[DATECOMPLETE]),
1, "January",
2, "February",
3, "March",
4, "April",
5, "May",
6, "June",
7, "July",
8, "August",
9, "September",
10, "October",
11, "November",
12, "December"
)

Then, sort by the "MonthNumber" but show the "MonthName"

 

 

 




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

Proud to be a Datanaut!
Private message me for consulting or training needs.




View solution in original post

2 REPLIES 2
hmeltonPSL
Helper II
Helper II

SWITCH worked.

Monthname = SWITCH(Reports_vwAllWorkOrders[Month], 1,"Jan", 2,"Feb",3,"Mar",4,"April", 5,"May",6,"Jun",7,"Jul",8,"August",9,"September",10,"October",11,"November",12,"December")
collinq
Super User
Super User

Hi @hmeltonPSL ,

Direct Query adds a challenge to this but the easiest way is probably to make two separate DAX columns.  

The first one is to create the Month Number like this:
MonthNumber = MONTH('Reports_vwAllWorkOrders'[DATECOMPLETE])

Then, you can use a "Switch" to change the number to words:
MonthName =
SWITCH(
MONTH('Reports_vwAllWorkOrders'[DATECOMPLETE]),
1, "January",
2, "February",
3, "March",
4, "April",
5, "May",
6, "June",
7, "July",
8, "August",
9, "September",
10, "October",
11, "November",
12, "December"
)

Then, sort by the "MonthNumber" but show the "MonthName"

 

 

 




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

Proud to be a Datanaut!
Private message me for consulting or training needs.




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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