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

Convert month number to month name

Hi Guys,

 

I have a table with month number = 1,2,3,4,5,6 etc... I would like to convert it into month name = Jan, Feb, Mar, Apr, May, etc..

I duplicated the Month number field and used the below script to covert to month name:

Month =
SWITCH (
[Date Granularity.Level 2: Month],
1, "Jan",
2, "Feb",
3, "Mar",
4, "Apr",
5, "May",
6, "Jun",
7, "Jul",
8, "Aug",
9, "Sep",
10, "Oct",
11, "Nov",
12, "Dec",
BLANK ()
)

 

However I am getting the below message: Can anyone tell me what is going in here?

month number.JPG

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@Anonymous

 

Hi, Switch function is DAX and you are in Query Editor with work with Power Query

 

The most simple way to obtain this is:

 

Add Column--> Conditional Column and Enter the conditions

 

Regards

 

Victor




Lima - Peru

View solution in original post

2 REPLIES 2
DaveBoylan
New Member

format(date(2020,[your month number],1),"MMM")
Vvelarde
Community Champion
Community Champion

@Anonymous

 

Hi, Switch function is DAX and you are in Query Editor with work with Power Query

 

The most simple way to obtain this is:

 

Add Column--> Conditional Column and Enter the conditions

 

Regards

 

Victor




Lima - Peru

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
Top Kudoed Authors