Forum Discussion

romoguy15's avatar
romoguy15
Helper IV
4 years ago
Solved

Split multiple columns in one step

Hello, I have two date and time colums that I am needing to split by delimiter and I want to split all two of these columns into one step instead of having to do it in individual steps. I tried a couple of methods but have been unsuccessful in finding a solution. I am trying to just pull the date only out of the columns because it also includes the time

 

 

This is what the columns currently look like

 

 

 

 

  • Hi romoguy15 ,

     

    If your columns are already of the type datetime, then you could use this statement:

    = Table.TransformColumns(#"Changed Type",{{"Work Order Date Created", DateTime.Date, type date}, {"Work Order Date Completed", DateTime.Date, type date}})

     

    In advanced editor it would look like this:

    #"Extracted Date" = Table.TransformColumns(#"Changed Type",{{"Start date time", DateTime.Date, type date}, {"End date time", DateTime.Date, type date}}),

     

    Let me know if this helps!

     

    /Tom
    https://www.tackytech.blog/
    https://www.instagram.com/tackytechtom/

5 Replies

  • tackytechtom's avatar
    tackytechtom
    Most Valuable Professional

    Hi romoguy15 ,

     

    If your columns are already of the type datetime, then you could use this statement:

    = Table.TransformColumns(#"Changed Type",{{"Work Order Date Created", DateTime.Date, type date}, {"Work Order Date Completed", DateTime.Date, type date}})

     

    In advanced editor it would look like this:

    #"Extracted Date" = Table.TransformColumns(#"Changed Type",{{"Start date time", DateTime.Date, type date}, {"End date time", DateTime.Date, type date}}),

     

    Let me know if this helps!

     

    /Tom
    https://www.tackytech.blog/
    https://www.instagram.com/tackytechtom/

    • romoguy15's avatar
      romoguy15
      Helper IV

      Well this method worked alot smoother than I was trying. Thank you

    • Anonymous's avatar
      Anonymous
      Not applicable

      or

       

      let
          Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Zc67DcAgDIThVZBrhMzZkMRdBkBKj9h/jTwc0qT99J90vVOuCQkIq2ELR6NIeXHJbLqGvdGInSCOxQpuiwR1WUzxVUmeJYzZK3FRkzqj7RdlfsmEZ3X9+mWT2KD31zFO", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [wodcr = _t, wodco = _t]),
          #"Changed Type" = Table.TransformColumnTypes(Source,{{"wodcr", type datetime }, {"wodco", type datetime}}),
          ttc=Table.TransformColumns(#"Changed Type",{{"wodcr", each DateTime.Date(_), type date},{"wodco", each DateTime.Date(_), type date}})
      in
          ttc
    • romoguy15's avatar
      romoguy15
      Helper IV

      This one is also really helpful too and works. For example if I am not trying to split dates but something else, I always wanted to know how to split two columns in one step