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
NBOnecall
Helper V
Helper V

Converting Text to Date with MMM, DD, YYYY, HH:MMM PDT

Hi, 

 

I have looked throughout this forum and other online resources and I cannot find an example with my criteria. I would like to convert the following text column into MM/DD/YYYY date value. 

 

image.png

 

The difference between what I was able to research was this has "APR 1, 2018 timestamp" vs "04/01/2018 timestamp." 

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@NBOnecall,

Here is an example how you could achieve this in Query Editor:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WciwoUjDUUTAyMLRQMLQyNLAyNFNw9FUIcAlRio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), {"Column1.1", "Column1.2", "Column1.3", "Column1.4", "Column1.5", "Column1.6"}),
    #"Inserted Merged Column" = Table.AddColumn(#"Split Column by Delimiter", "Merged", each Text.Combine({[Column1.1], Text.From([Column1.2], "en-US"), Text.From([Column1.3], "en-US")}, " "), type text),
    #"Changed Type" = Table.TransformColumnTypes(#"Inserted Merged Column",{{"Merged", type date}}),
    #"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"Merged"})
in
    #"Removed Other Columns"

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@NBOnecall,

Here is an example how you could achieve this in Query Editor:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WciwoUjDUUTAyMLRQMLQyNLAyNFNw9FUIcAlRio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), {"Column1.1", "Column1.2", "Column1.3", "Column1.4", "Column1.5", "Column1.6"}),
    #"Inserted Merged Column" = Table.AddColumn(#"Split Column by Delimiter", "Merged", each Text.Combine({[Column1.1], Text.From([Column1.2], "en-US"), Text.From([Column1.3], "en-US")}, " "), type text),
    #"Changed Type" = Table.TransformColumnTypes(#"Inserted Merged Column",{{"Merged", type date}}),
    #"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"Merged"})
in
    #"Removed Other Columns"

Thanks. Pretty new to Power BI and didn't realize there was a "Text to Column" like option in the query editor. 

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.