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
KWelsh8144
Helper II
Helper II

Month Name from Date in Direct Query

I was able to get the month number in the direct query report, but would like to display the month name. SWITCH and FORMAT are not functions I can use in direct query. What are other options to return the month name?

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@KWelsh8144,

What error message do you get? And what is your data source? I make a test in Power BI Desktop October release( 2.63.3272.40461) by connecting to SQL Server with DirectQuery mode, switch function works as expected.

Monthname = SWITCH(Main[month], 1,"Jan", 02,"Feb",3,"Mar",4,"April", 5,"May",6,"Jun",7,"Jul",8,"August",9,"September",10,"October",11,"November",12,"December")

1.PNG

Regards,
Lydia

View solution in original post

4 REPLIES 4
ManviJ
Frequent Visitor

I am also getting the same issue while running the switch statement and getting the value as (Blank). Can anyone please help

KWelsh8144
Helper II
Helper II

I'm using the Oct 2019 version and connecting to an Oracle database. For whatever reason, when i type in 'switch' it comes up with a red underline as if i cannot use this. However,  when i copied and pasted what you have above, it works. thanks.

Anonymous
Not applicable

 
Anonymous
Not applicable

@KWelsh8144,

What error message do you get? And what is your data source? I make a test in Power BI Desktop October release( 2.63.3272.40461) by connecting to SQL Server with DirectQuery mode, switch function works as expected.

Monthname = SWITCH(Main[month], 1,"Jan", 02,"Feb",3,"Mar",4,"April", 5,"May",6,"Jun",7,"Jul",8,"August",9,"September",10,"October",11,"November",12,"December")

1.PNG

Regards,
Lydia

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