Forum Discussion
Data Type conversion problem for DATE in Power Query on au.finance.yahoo.com
- 1 year ago
Hey Schch ,
as Alex87 said promote first row to headers, you can find how to do that here: Promote or demote rows and column headers (Power Query) - Microsoft Support
And then you get error because 'Sept' is not official shortened version of september - it should be 'Sep'. So before you change column type to date add a step and replace 'Sept' to 'Sep' (instructions: Replace values (Power Query) - Microsoft Support) or just use this M code:
= Table.ReplaceValue(#"Changed Type","Sept","Sep",Replacer.ReplaceText,{"Date"})
After that just check if other months use correct short version of the month and if not change it in the same manner before converting to date type.Hope it helps!
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hey Schch ,
as Alex87 said promote first row to headers, you can find how to do that here: Promote or demote rows and column headers (Power Query) - Microsoft Support
And then you get error because 'Sept' is not official shortened version of september - it should be 'Sep'. So before you change column type to date add a step and replace 'Sept' to 'Sep' (instructions: Replace values (Power Query) - Microsoft Support) or just use this M code:
= Table.ReplaceValue(#"Changed Type","Sept","Sep",Replacer.ReplaceText,{"Date"})
After that just check if other months use correct short version of the month and if not change it in the same manner before converting to date type.
Hope it helps!
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
May I know why this function;
= Table.AddColumn(#"Added Custom4", "Month Name", each Date.ToText([DateKey],"MMM"))
returns Sept i.s.o. Sep?
Other short month name works perfectly (ie, Jan, Feb, Mar, Apr, May, Jun, July, Aug, Oct, Nov, & Dec)