Forum Discussion

modwonka's avatar
modwonka
Helper I
4 years ago
Solved

Extract date from parenthesis

Hello everyone,   first of all, thanks for your help.   I have one column with a long part of the text in each row from which I would like to extract a date.   This is one row: "TEXT_EXAMPLE1 (...
  • Jakinta's avatar
    4 years ago

    If your desired date/time is always inbetween 3rd pair of parenthesis, you can add step below...

    = Table.AddColumn(PriorStepName, "Custom", each Text.BetweenDelimiters([TextColumnName], "(", ")", 2, 0))

     

    If not you might do it relative to "TEXT_EXAMPLE3" position...

    = Table.AddColumn(PriorStepName, "Custom", each let l=List.Transform( Text.Split([TextColumnName]," "), each Text.Remove(_,{"(",")",","})), i=List.PositionOf(l, "TEXT_EXAMPLE3") in l{i+1} & " " & l{i+2} )

     

  • v-kelly-msft's avatar
    v-kelly-msft
    4 years ago

    Hi  modwonka ,

     

    Previousstep refers to the previous applied step,not the column.

    Take below steps as example:

    Now if you wanna create a new step,then "Added Custom" is the previous step.

    Check my .pbix file attached.

     

    Best Regards,
    Kelly

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