Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Replace values between square brackets in a Query

Hi, PowerBI newbie here but loving it!   In my Query I have a column where the values may have text in square brackets    eg: This is some text [and this is other text]   I would like to remove...
  • ElenaN's avatar
    7 years ago

    Hello,

     

    If you just want to replace the value in the brackets you can create a new column (Add Custom Column option in Power Query) and use this code:

     

    =Text.Replace([Column1], Text.BeforeDelimiter(Text.AfterDelimiter([Column1], "["), "]"), "")

    The code replaces whatever it is found between brackets with empty string. You can change that according to your needs.

     

    Regards,

    ElenaN