Forum Discussion
Transform text to datetime
I have a ADE function which PowerBI calls that returns a couple of columns, one of which is ingestTime. When I go to transform the data from a text value to 'DateTime' it throws an error: Expression.Error: We cannot convert the value "09/23/2020 11:05:10 ..." to type DateTimeZone. I have confirmed that the date is formatted as such: '09/23/2020 11:05:10 PM'. I'm not selecting DateTimeZone so I don't know why it is even throwing this error.
ADE Function (generally): Table | project Column1, Column2, format_datetime(ingestTime, 'MM/dd/yyyy h:mm:ss tt')
Hi Anonymous ,
Please change the format to "MM/dd/yyyy h:mm:ss AM/PM" to have a try. You also could use custom format in Model view like below:
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings
2 Replies
- FrankATCommunity Champion
Hi Anonymous
may be you can change data type with locale in Power Query (see figure):
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut) - v-xuding-msftCommunity Support
Hi Anonymous ,
Please change the format to "MM/dd/yyyy h:mm:ss AM/PM" to have a try. You also could use custom format in Model view like below:
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings