Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Split text based on character

Hi, I have a text value that I want to be able to split in two different places. The value looks like the following:

 

XXXX_YY1234_V1_AA

 

I am trying to extract just the "YY1234" part. I would do this with just the RIGHT() and LEFT() functions but the number of characters in each section of the value varies. Sometimes the first part is "XXXX" and other times its "XX" for example. So I cant specify a specific character number to start the split on. Can anyone help me with a formula that would specify that I want to split the value to return everything to the right of the first underscore and everything to the left of the second underscore?

 

Thank you for any help!

 

Dan

1 Reply

  • Anonymous ,

     

    You can get your result using Power Query setting.

    Go to Power Query Editor --> Select your column --> right click on it --> select Split by delimiter --> choose custom option and type "_" underscore and hit okay.

    Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.