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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Thad
Frequent Visitor

How do I change a columns date format to "MMM-YY" in Power Query?!

I need to transform a column from dd-mm-yyyy to mmm-yy before merging it with another column, so it has to happen in the query editor and not through a measure. 

 

How? Nothing I have tried worked. It can't be that difficult.

 

Thanks in advance.

2 ACCEPTED SOLUTIONS

Hi @Thad try with Capitalized M as below

Date.ToText([YourColumnForDate],"MMM-yy")

 

If not ok after that, check link what could be wrong with your case.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






View solution in original post

v-jiewu-msft
Community Support
Community Support

Hi @Thad ,

Please try the following methods and check if they can solve your problem:

1.Create the simple table.

vjiewumsft_0-1709026508325.png

2.Click the Transform data and add custom column.

= Text.From(Date.MonthName([Joining date]))&"/"&Text.From(Date.Year([Joining date]))

vjiewumsft_1-1709026524659.png

3.The result is shown below.

vjiewumsft_2-1709026559629.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

View solution in original post

7 REPLIES 7
v-jiewu-msft
Community Support
Community Support

Hi @Thad ,

Please try the following methods and check if they can solve your problem:

1.Create the simple table.

vjiewumsft_0-1709026508325.png

2.Click the Transform data and add custom column.

= Text.From(Date.MonthName([Joining date]))&"/"&Text.From(Date.Year([Joining date]))

vjiewumsft_1-1709026524659.png

3.The result is shown below.

vjiewumsft_2-1709026559629.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

some_bih
Super User
Super User

Hi @Thad try custom column in PQ

Date.ToText([YourColumnForDate],"mmm-yy")





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Thad
Frequent Visitor

Wish that was it. Unfortunately, this results in a 4-digit-value with no letters, e.g. 31.07.2022 becomes "00-22". May that be due to a wrong locale setting?

Hi @Thad try with Capitalized M as below

Date.ToText([YourColumnForDate],"MMM-yy")

 

If not ok after that, check link what could be wrong with your case.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Thad
Frequent Visitor

That worked - thanks! 

bhelou
Responsive Resident
Responsive Resident

hi , share some sample please to see the type of the column and data  inside it 

Thad
Frequent Visitor

The data comes in dd-mm-yyyy format as text.

I am now trying a workaround by extracting the name of the month from each row (after converting the column to date format, ofc), then keeping only the first three letters of that column and then merging it with the extracted year. If you have an easier way, I woudn't be mad.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.