Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lunchbox
New Member

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')

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @lunchbox ,

 

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:

1.PNG

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xuding-msft
Community Support
Community Support

Hi @lunchbox ,

 

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:

1.PNG

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
FrankAT
Community Champion
Community Champion

Hi @lunchbox 

may be you can change data type with locale in Power Query (see figure):

 

25-09-_2020_22-25-51.png

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.