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
joansinho
Advocate I
Advocate I

HTML Cleaning

Hi all,
I am cleaning HTML text. So far I have been able to clean most of it. However, I am not able to clean this string "target="_blank"/a." I get some rows that look like: "target="_blank"/ahttp://www.youtube.com" I would like to remove this part "target="_blank"/a"and keep "http://www.youtube.com".
The code I have so far is this and it works well:

 

= (HTML as any) =>

let

    Source = if HTML = null then

        ""

    else

        Text.From(HTML),

    SplitAny = Text.SplitAny(Source,"<>"),

    ListAlternate = List.Alternate(SplitAny,1,1,1),

    ListSelect = List.Select(ListAlternate, each _<>""),

    TextCombine = Text.Combine(ListSelect, "")

in

    TextCombine



Thank you in advance

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @joansinho

You could try to refer to these articles:

Reference:https://social.technet.microsoft.com/Forums/lync/en-US/b080d122-14f0-43bc-8a86-f50cdf1c32d8/removing...

 

https://community.powerbi.com/t5/Desktop/Robust-function-to-remove-HTML-tags/m-p/171081/highlight/tr...

 

Best Regards,

Lin

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

Thank you @v-lili6-msft!

 

I have used the websites you recommended to be able to use the code I posted above. I have not been able to figure out how to add a line to remove the part I mentioned. It should be something like 

 

 

If( table) contains "target="_blank"/a ", remove "target="_blank"/a" and keep the rest of the string.

 

 "target="_blank"/ahttp://www.youtube.com"

Remove = "target="_blank"/a "

Keep = "http://www.youtube.com"

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.