Forum Discussion

LFK73's avatar
LFK73
New Member
4 years ago
Solved

Create new columns with substrings from another column

I know there are a number of articles on this subject but I cant seem to make any of these work for me.  I have a table populated by an API call.  I need to create 2 columns taking part of the string...
  • deevaker's avatar
    4 years ago

    Hi Mate,

     

    You can use this calculation to get the location : 

    Location =
    Var _First = Len(LEFT('Table'[Url],SEARCH("/",'Table'[Url],2)))
    Var _Second = Len(Left('Table'[Url], SEARCH("/",'Table'[Url],_First+1)))
    return
    MID('Table'[Url],_First+1,_Second-_First-1)

    (Please refer to the attached screenshot)

    Same logic you can use to get the country . 🙂