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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Best way to remove HTML tags in M or DAX from very large text

Hi,

What is the best way to remove HTML tags from a very large text field in M or DAX?

Currently I am using Html.Table but my table contains over 20 lakh records with very large text (exceeding 300 characters) and it takes more than 0.5 hour to load up after I click "Close & Apply". Its very frustrating to wait this long for a simple modification. Can it be moved to DAX? Any ideas on how to do it?

 

Thanks

Nirmit

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1640673270585.png

Here are the steps you can follow:

1. Create calculated column.

Column =
PATHITEM(
    SUBSTITUTE(
        SUBSTITUTE([Html], ">", "|"),
        "</","|"), 2,TEXT)

2. Result:

vyangliumsft_1-1640673270586.png

 

Best Regards,

Liu Yang

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

5 REPLIES 5
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1640673270585.png

Here are the steps you can follow:

1. Create calculated column.

Column =
PATHITEM(
    SUBSTITUTE(
        SUBSTITUTE([Html], ">", "|"),
        "</","|"), 2,TEXT)

2. Result:

vyangliumsft_1-1640673270586.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

 

This is the related document, you can view this content:

https://community.powerbi.com/t5/Desktop/Removing-HTML-Script-from-data-in-Query-Editor/td-p/351995

https://community.powerbi.com/t5/Power-Query/Removing-HTML-tags-complex/m-p/1221727

https://community.powerbi.com/t5/Power-Query/Removing-HTML-tags-and-reordering-text/m-p/1900057

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

@v-yangliu-msft  i have trid HTML.TABLE in M already. These posts show more complicated way of achieving the same result so not sure if these would really be any faster? Again these are older posts probably before the HTML.TABLE function was released.

Any ideas on DAX? I am more keen on doing that to save time in loading up the queries.

parry2k
Super User
Super User

@Anonymous did you tried using Power BI dataflows, just copy the queries from desktop to dataflow and see if it performs better. if you have premium then turn on Enhanced computer engine for dataflow and it will surely be way faster.

 

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k we can't really move to dataflow option for the complexity involved. I will anyway test it and update here if see any improvements. Thanks for replying.
Any ideas on DAX? I am more keen on doing that to save time in loading up the queries.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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