We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Could anyone help to convert this date format in Power Query?
2025-01-22T09:42:02.541-06:00[America/Chicago]
-> 1/22/2025 9:42:02 AM
Thanks,
Solved! Go to Solution.
Here's the function you can re-use in Power Query.
Create a blank query and paste below M in it.
(DateText as text) as datetime =>
let
CleanText = Text.BeforeDelimiter(DateText, "["),
Parsed = DateTimeZone.FromText(CleanText),
Result = DateTimeZone.RemoveZone(Parsed)
in
Result
You will have
When you Add a Custom Column invoke this Function
It will return results as in below picture.
is there another way instead of the function?
Hi
Yes! Function is better when you need to reuse it later in your data transformation. If you prefer a regular way for a one-time use,
When you add a Custom Column, paste the M code
let
CleanText = Text.BeforeDelimiter([OriginalDate], "["),
Parsed = DateTimeZone.FromText(CleanText),
Result = DateTimeZone.RemoveZone(Parsed)
in
Result
and replace the [OriginalDate] with your actual Date Column.
Here's the function you can re-use in Power Query.
Create a blank query and paste below M in it.
(DateText as text) as datetime =>
let
CleanText = Text.BeforeDelimiter(DateText, "["),
Parsed = DateTimeZone.FromText(CleanText),
Result = DateTimeZone.RemoveZone(Parsed)
in
Result
You will have
When you Add a Custom Column invoke this Function
It will return results as in below picture.
it is harder than I thought.
Thank you for your help.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 54 | |
| 39 | |
| 32 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 64 | |
| 63 | |
| 37 | |
| 36 | |
| 22 |