Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
shuhn1229
Resolver I
Resolver I

Extracting From A Field with Multiple Delimiters

Hi all,

 

I am relatively new to power query and am trying to extract all the text between [] delimiters in a field, if they exist. See example below:

 

InputOutput
[Apples] - 46 [Oranges] -1Apples, Oranges
[Oranges] -1Oranges
I need some fruit 

 

The problem I am running into is the delimeters between text in the ribbon is only returning one delimeter. I looked into this with this awesome thread, but I can't wrap my head around using "[" and "]" to begin and close the delimiters, respectively.

 

@ronrsnfld 

@AntrikshSharma 

Thanks

1 ACCEPTED SOLUTION
jbwtp
Memorable Member
Memorable Member

Hi @shuhn1229,

 

This may help:

Table.AddColumn(#"Changed Type", "Calculated", each Text.Combine(List.Transform(List.Select(Text.Split([Input], "["), each Text.Contains(_, "]")), each Text.BeforeDelimiter(_, "]")), ", "))

 

Cheers,

John

View solution in original post

4 REPLIES 4
jbwtp
Memorable Member
Memorable Member

Hi @shuhn1229,

 

This may help:

Table.AddColumn(#"Changed Type", "Calculated", each Text.Combine(List.Transform(List.Select(Text.Split([Input], "["), each Text.Contains(_, "]")), each Text.BeforeDelimiter(_, "]")), ", "))

 

Cheers,

John

Thanks John!!!!  Yours was the best answer of all!!!!!

Excellent!!!!!

looks like it's working great! you the man (or woman!)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors