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

Text to Date M-Query

Hi Team,

I'm trying to convert text to date format however i can't get proper result.

 

Look like Month have text data type.

 

i need  "MMM-YY" format with M Query (or) DAX.

 

screen.PNG

Thanks,

KV's

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , what is data type of month as of now. It is date then you can change display format or try this as new column

 

New Format = format([month],"MMM-YY")

 

if it text then try like

New Date = "01-" & left([month],3) & "-" & right([Month],2)  // Change data type to date then

New Format = format([New Date],"MMM-YY")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , what is data type of month as of now. It is date then you can change display format or try this as new column

 

New Format = format([month],"MMM-YY")

 

if it text then try like

New Date = "01-" & left([month],3) & "-" & right([Month],2)  // Change data type to date then

New Format = format([New Date],"MMM-YY")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
nvprasad
Solution Sage
Solution Sage

Hi,

You can split the current format into month & year ( Jan, 20 ) then use Date.Fromtext to add a new column. Once the desired column is ready you can delete Month & Year columns.

 

Please refer to link.

https://docs.microsoft.com/en-us/powerquery-m/date-fromtext

 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Hi,

You can split the current format into month & year ( Jan, 20 ). Use If function in M code to convert month name to number ( Jan to 1, Feb to 2) then use Date.Fromtext to add a new column.  Once the desired column is ready you can delete Month & Year columns.

 

Please refer to the link.

https://docs.microsoft.com/en-us/powerquery-m/date-fromtext

 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Helpful resources

Announcements
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!

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.

Top Solution Authors