Forum Discussion

Zabeer's avatar
Zabeer
Helper I
5 years ago
Solved

Extract field value in Power Query to a new column based on conditions

Hello everyone, I wish to extract specific values in a column to a new column. The rule is that the values need to start with 75 or 76 and can have maximum of 10 digits. Examples below should make...
  • DataInsights's avatar
    5 years ago

    Zabeer,

     

    Try this custom column in Power Query:

     

    if Text.PositionOf([Input], "75") <> - 1 then
      Text.Middle([Input], Text.PositionOf([Input], "75"), 10)
    else if Text.PositionOf([Input], "76") <> - 1 then
      Text.Middle([Input], Text.PositionOf([Input], "76"), 10)
    else
      null