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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
raymondpocher
Advocate III
Advocate III

PowerQuery: remove text string between custom delimiters

Hi community,

 

I want to achieve something simple but in power query I feel as if I am making way too compley. So after not finding anything on google I turn to you 🙂

 

Suppose I have loaded URLs into PowerQuery. Here a sample input:

.com/watch?t=606&v=rpcd-MEmzAc&ebc=ANyPxKo6RT9WxuEfw

 

I am now looking for a method to remove certain texts (above in bold):

.com/watch?v=rpcd-MEmzAc   

t=606& (string starting with a t= and ending with an or nothing)

&ebc=ANyPxKo6RT9WxuEfw (string starting with &ebc= and ending with an or nothing)

 

I tried:

 #"REMOVE" = Table.TransformColumns(#"PREVIOUS_STEP", {{"COLUMN_TO_REPLACE", each Text.Remove(_, Text.BetweenDelimiters(_, "t=", "&") ), type text}})

 

But in case the Parameter doesn't occur at all I will receive an error. It should only then replace the value if it is possible. 

 

 

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

#"REMOVE" = Table.TransformColumns(#"PREVIOUS_STEP", {{"COLUMN_TO_REPLACE", each Text.Replace(_, Text.BetweenDelimiters(_, "t=", "&"), ""), type text}})

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

#"REMOVE" = Table.TransformColumns(#"PREVIOUS_STEP", {{"COLUMN_TO_REPLACE", each Text.Replace(_, Text.BetweenDelimiters(_, "t=", "&"), ""), type text}})

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Hi, I am using this function to replace elements within html tags in a text.

It seems that the function does not replace the text for all occurrences, but only for the first one it finds.

Is it my mistake on how I am applying it or should some modification be applied?

    #"Rimosso contenuto span" = Table.TransformColumns(#"Rinominate colonne4", {{"Descrizione", each Text.Replace(_, Text.BetweenDelimiters(_, "<span", ">"), ""), type text}}),

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.