Hi
In a Data export the Date in the data set is as follows
Data Type: Text
201506 indicating YYYYMM
How do I convert to Dates in MMM-YY format in Power Query, please?
I've tried to change the Data Type to Date, but get an Error.
Please advise.
Thank you
Eduard
Hi Eduard,
You can use the text functions to build a valid date, then format it: https://msdn.microsoft.com/en-us/library/mt296604.aspx
=Date.ToText(Date.From("01/"&Text.End([date],2)&"/"&Text.Start([date],4)),"MMM-yyyy")
Hi Catalin
Thanks, it results in the correct format
However, the resulting dates are incorrect - it defaults all the dates to Jan-2015 or Jan-2016.
How do we need to change the formula to rectify that, please?
Thank you
Eduard
You have to be careful to the date format you build: I used "01/" as the first part of the string, and obviously it should represent the missing part of the date: day, in a dd/mm/yyyy format. If you have mm/dd/yyyy date format, you have to put month first in the string :), or specify the culture: en-US, en-AU, or any.
You have to get used to go the library: https://msdn.microsoft.com/en-us/library/mt260703.aspx