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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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