Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
I am cracking my head trying to convert the data type from text to datetime using the DateTime.FromText function in Power Query.
Basically, I have the following text format:
| Oct 23, 2022 8:00PM UTC |
I tried the following function, but it did not work:
DateTime.FromText([ColumnName], [Format="MMM dd, yyyy h:mmtt"])
I know that I also have to define the local culture as a parameter but not sure if there is such for UTC format. I think there is something wrong with how I am providing the format code or maybe there is an easiest solution to do that.
Any good soul can help?
Solved! Go to Solution.
Hello - this will make the conversion:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k8uUTAy1lEwMjAyUrCwMjAI8FUIDXFWio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
DateTimeUTC = Table.AddColumn(Source, "DateTimeUTC", each DateTime.AddZone(DateTime.FromText(Text.BeforeDelimiter([Column1], " UTC")),0)),
#"Changed Type" = Table.TransformColumnTypes(DateTimeUTC,{{"DateTimeUTC", type datetimezone}})
in
#"Changed Type"
Hello - this will make the conversion:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k8uUTAy1lEwMjAyUrCwMjAI8FUIDXFWio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
DateTimeUTC = Table.AddColumn(Source, "DateTimeUTC", each DateTime.AddZone(DateTime.FromText(Text.BeforeDelimiter([Column1], " UTC")),0)),
#"Changed Type" = Table.TransformColumnTypes(DateTimeUTC,{{"DateTimeUTC", type datetimezone}})
in
#"Changed Type"
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.