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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
topazz11
Helper III
Helper III

date time format

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,

1 ACCEPTED SOLUTION
MasonMA
Community Champion
Community Champion

@topazz11 

 

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 

MasonMA_0-1757536428829.png

 

When you Add a Custom Column invoke this Function

MasonMA_1-1757536530946.png

 

It will return results as in below picture. 

MasonMA_2-1757536551677.png

 

 

View solution in original post

4 REPLIES 4
topazz11
Helper III
Helper III

is there another way instead of the function?

MasonMA
Community Champion
Community Champion

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. 

 

 

MasonMA
Community Champion
Community Champion

@topazz11 

 

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 

MasonMA_0-1757536428829.png

 

When you Add a Custom Column invoke this Function

MasonMA_1-1757536530946.png

 

It will return results as in below picture. 

MasonMA_2-1757536551677.png

 

 

it is harder than I thought.

Thank you for your help.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.