Change Date column from dd/mm/yyyy to yyyy/MM/dd

Skybluekid

Well-known Member
Joined
Apr 17, 2012
Messages
1,230
Office Version
  1. 365
Platform
  1. Windows
Hi

I would like to change a date column in Power Query from dd/mm/yyyy to yyyy/MM/dd?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Why do you need it changed in PQ? Surely the output table is where the formatting is needed?
 
Upvote 0
I guess so, just thought it would save a step afterwards. Is it possible though?
 
Upvote 0
Maybe you can define the date date as text then use Text.Reverse([date as text])?
Edit: no, you cannot. What was I thinking? #sleepyhead morning...

Split on delimiter and combine the date Parts in the order you want them.

PS: you can't change a format in PQ, only a data type. As @RoryA said, that's done in the output. And you only need to do this once.
 
Last edited:
Upvote 0
I convert it in SQL Server before I bring it in:
convert(datetime,'18-11-2019 00:00:00',105) --will return 2019-11-18 00:00:00.000
 
Upvote 0
I convert it in SQL Server before I bring it in:
convert(datetime,'18-11-2019 00:00:00',105) --will return 2019-11-18 00:00:00.000
I guess it is still seen as date in PQ and the type "date" is applied, undoing your convert. Look for the #"Changed Type" step and update that field to text. Remember to confirm "Replace current".
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top