Forum

Error When i fix th...
 
Notifications
Clear all

Error When i fix the date using (power query - custom column -)

6 Posts
2 Users
0 Reactions
146 Views
(@ammarhammad)
Posts: 3
Active Member
Topic starter
 

Hi all,

kindly I am facing a problem once I use a custom column - power query - for the #date equation

Error.png

Note: my Excel is 2019

I attached a file excel you can check it 

 

Thank You In Advance 

 
Posted : 24/10/2020 6:50 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Ammar,

I presume that you are using dd/mm/yyyy?

After splitting the text into 3 columns, recombine it with / as the separator.  You can then convert it using locale to a date.

See attached file for the query/steps.

Regards

Phil

 
Posted : 24/10/2020 8:03 am
(@ammarhammad)
Posts: 3
Active Member
Topic starter
 

Hi Philip

Thank You for the clarification

 

but actually, I'm looking to solve the error if I co with -power query ---> add column ---->custom column 

 

same in the excel and photo 

I would like to know why I got Error?

 
Posted : 24/10/2020 9:36 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Ammar,

The order of the parameters for #date are year, month, day.

You've got day, month, year.

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

This is the correct format

= Table.AddColumn(#"Changed Type1", "Custom", each #date([Test.3],[Test.2],[Test.1]))

Regards

Phil

 
Posted : 24/10/2020 10:10 am
(@ammarhammad)
Posts: 3
Active Member
Topic starter
 

Many Thanks

 
Posted : 24/10/2020 12:17 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

You're welcome.

 
Posted : 24/10/2020 9:54 pm
Share: