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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Swapnil_
Regular Visitor

Change Text column to Date Format

Hi,

I am getting data from source as a csv file. The column contains data as Apr 20, May 20 .....till March 23.

I want to change its format from text to date (pref Month Year) , I have tried change type options available in power query(direct date selection as well as Using locals )  for direct but it is not converting the format as I want instead I am getting values like April 20-2023..can you please provide any suggestion?

1 ACCEPTED SOLUTION
m_dekorte
Resident Rockstar
Resident Rockstar

Hi @Swapnil_ 

 

Give this a go: 

Date.FromText( _, [Format="MMM yy", Culture="en-US"])

Depending on how and where you use this formula, you might need to replace the underscore with the column name in square brackets that holds this value: Date.FromText( [Date], [Format="MMM yy", Culture="en-US"])

 

Here's a sample, you can copy this script into a new blank query.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Rc4xCsJAGAXhq8jWFr6XEwTEQogWlkuKNSw2oiEYwdsnBH6nm2r4ck7tOO18SP0+p678Is/zi3xGtvMj8lbHyOvwiby8v5HHOvwPZZ1py1O9R3ZlitwMwiAMwiAMwiAMwiAMwmAMxmAMxmAMxmAMxmAMxmAMxtBgaDCs2S8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
    GetDate = Table.TransformColumns(Source,{{"Date", each Date.FromText(_, [Format="MMM yy", Culture="en-US"]), type date}})
in
    GetDate

 

 

With this result:

m_dekorte_0-1685619438075.png

 

Power Query itself doesn't offer any date formatting options - to alter the display of that value - this is something you'll have to save for the application that receives it's output, like Excel or Power BI for example.

 

Ps. If this helps solve your query please mark this post as Solution, thanks!

View solution in original post

2 REPLIES 2
m_dekorte
Resident Rockstar
Resident Rockstar

Hi @Swapnil_ 

 

Give this a go: 

Date.FromText( _, [Format="MMM yy", Culture="en-US"])

Depending on how and where you use this formula, you might need to replace the underscore with the column name in square brackets that holds this value: Date.FromText( [Date], [Format="MMM yy", Culture="en-US"])

 

Here's a sample, you can copy this script into a new blank query.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Rc4xCsJAGAXhq8jWFr6XEwTEQogWlkuKNSw2oiEYwdsnBH6nm2r4ck7tOO18SP0+p678Is/zi3xGtvMj8lbHyOvwiby8v5HHOvwPZZ1py1O9R3ZlitwMwiAMwiAMwiAMwiAMwmAMxmAMxmAMxmAMxmAMxmAMxtBgaDCs2S8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
    GetDate = Table.TransformColumns(Source,{{"Date", each Date.FromText(_, [Format="MMM yy", Culture="en-US"]), type date}})
in
    GetDate

 

 

With this result:

m_dekorte_0-1685619438075.png

 

Power Query itself doesn't offer any date formatting options - to alter the display of that value - this is something you'll have to save for the application that receives it's output, like Excel or Power BI for example.

 

Ps. If this helps solve your query please mark this post as Solution, thanks!

Thanks @m_dekorte  it worked!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors