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

Join 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.

Reply
Anonymous
Not applicable

how to create date/time/timezone field from combining date and text fields

I have the following fields:

[Date]        data type: date             setting: M/D/YYYY                               sample value: 9/1/2020

[Time]        data type: text              format: H:MM:SS AM/PM TZ              sample value: 8:05:30 AM ET

 

I need to create a derived field of type date/time/timezone in Power Query using these two fields.  How can I create this field?  For example, for the sample values above, I expect an output like:

9/1/2020 8:05:30 AM -05:00

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Go to query editor,select column "Time">"Transform">"Split column":

v-kelly-msft_0-1607653026668.png

 

And you will see:

v-kelly-msft_1-1607653039846.png

 

Then create a custom column as below:

v-kelly-msft_2-1607653099379.png

Finally you will see:

v-kelly-msft_3-1607653115848.png

 

For the M codes,see below:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WstQ31DcyMDJQ0lGysDIwtTI2UHD0VXANUYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Time = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Time", type text}}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "Time", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, true), {"Time.1", "Time.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Time.1", type time}, {"Time.2", type text}}),
    #"Added Custom2" = Table.AddColumn(#"Changed Type1", "Custom.1", each DateTime.AddZone([Date]&[Time.1],-5))
in
    #"Added Custom2"

Attachment is the related .pbix file.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

Does your data exist in tables?If possible,could you pls provide a table format,not just show the field.It would be more convenient to do the data transformation.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Anonymous
Not applicable

Hi @Anonymous ,

 

Go to query editor,select column "Time">"Transform">"Split column":

v-kelly-msft_0-1607653026668.png

 

And you will see:

v-kelly-msft_1-1607653039846.png

 

Then create a custom column as below:

v-kelly-msft_2-1607653099379.png

Finally you will see:

v-kelly-msft_3-1607653115848.png

 

For the M codes,see below:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WstQ31DcyMDJQ0lGysDIwtTI2UHD0VXANUYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Time = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Time", type text}}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "Time", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, true), {"Time.1", "Time.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Time.1", type time}, {"Time.2", type text}}),
    #"Added Custom2" = Table.AddColumn(#"Changed Type1", "Custom.1", each DateTime.AddZone([Date]&[Time.1],-5))
in
    #"Added Custom2"

Attachment is the related .pbix file.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.