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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
msantillan
Helper II
Helper II

Get the Text between delimitters from two columnsc M query

Is it possible to get the text between delimitters based from two columns?

I have this attempt code as an example:

 

Text.BetweenDelimiters(([Try1] and [Try2]), "try_", "_code")

 

Basically, I have two collumns which contains countless rows of either try_(get)_code and try2_(get)_code, and I only want to get the value of "(get)" from those in between try and code. Do note that (get) may vary and is just an example. The code above doesn't work. Any ideas?

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@msantillan 

You can just used the extact feature in query editor.
between.JPG

 


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@msantillan 

You can just used the extact feature in query editor.
between.JPG

 


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Adamtall
Resolver III
Resolver III

Hi,

 

If you want, you can do it in edit query.

Create a blank query any type in this query in advanced editor so you can see the logic.

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WKimqjE8sTgEjJR0lQyPj+OT8lFSlWB2IHFDA0AgoYW5hboEqA9RibAKUychKz8DQAxTPz8zPRBVPKk5JMwTKmJqYQSViAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Try1 = _t, Try2 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Try1", type text}, {"Try2", type text}}),
#"Inserted Merged Column" = Table.AddColumn(#"Changed Type", "Merged", each Text.Combine({[Try1], [Try2]}, ""), type text),
#"Extracted Text Between Delimiters" = Table.TransformColumns(#"Inserted Merged Column", {{"Merged", each Text.BetweenDelimiters(_, "_", "_"), type text}})
in
#"Extracted Text Between Delimiters"

 

/Adam

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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