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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Text.BetweenDelimiters function, bug or user error?

Greetings all,

I’m nesting the Text.BetweenDelimiters function within a Text.Select function and I’m getting a result that looks wrong. It looks like the BetweenDelimiters function is not working property; is this a bug or am I not understanding how the BetweenDelimiters works?

I’m trying to extract inbound ocean container IDs (from a SharePoint calendar if it matters). Those container IDs are surrounded by a dash at the front and an open paren after the ID. Hence, extraction between delimiters “-“, “(“.

That works great when both delimiters are present, I am indeed getting my container ID.

However, I believe that where there is no second delimiter, a null result should come back; all those “56pallets” should be null, yes?

Why is the Text.BetweenDelimiters function happy to ignore the absence of the second, enclosing delimiter?

Thanks!

bdpaasch_0-1692806452959.png

 

The code might be hard to read in the screen snip, here is the text of the code:

= Table.AddColumn(#"Changed Type1", "Container ID", each
     Text.Select
         (Text.BetweenDelimiters([Event Title], "-", "(" ),
     {"a".."z", "A".."Z", "0".."9"})
   )

 

1 ACCEPTED SOLUTION
mussaenda
Super User
Super User

Hi @Anonymous ,

 

Then nest your formula with if Text.Contains functions.

 

Like if the Event Title contains "-" and "(" then your nested  formula else, null

You think that will work for you?

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@mussaenda 

 

🎉😊👏🎉

= Table.AddColumn(#"Changed Type1", "Container ID", each

            if Text.Contains ([Event Title], "-") and Text.Contains ([Event Title], "(") then
                Text.Select
                      (Text.BetweenDelimiters([Event Title], "-", "(" ),
                {"a".."z", "A".."Z", "0".."9"})
           else null)

 

bdpaasch_0-1692884217590.png

 

 

 

mussaenda
Super User
Super User

Hi @Anonymous ,

 

Then nest your formula with if Text.Contains functions.

 

Like if the Event Title contains "-" and "(" then your nested  formula else, null

You think that will work for you?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.