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
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
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.