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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Remove HTML tags from columns

Hello,

I want to remove the HTML tags from my text columns, I tried multiple solutions on the community forum but even when I get something working I get an error in my custom column. The error is "Cannot convert a value of type Record to type Text".

 

bloody87_0-1672069427838.png

 

I tried this:

 

Text.Clean(
Text.Trim(

if Text.Contains([[ALL.achievements_last_week]], "<")
then Text.BeforeDelimiter([[ALL.achievements_last_week]], "<")
else
[[ALL.achievements_last_week]])
)

 

and

 

=Html.Table([ALL.achievements_last_week], {{"ExtractedText",":root"}})

 

 

I still get the error "Cannot convert a value of type Record to type Text"

 

1 ACCEPTED SOLUTION

@Anonymous 

You were almost there. I believe there's only a simple error in your code for the custom column. You had:

 

Html.Table([[Column1]], {{"ExtractedText",":root"}})

 

 with  [[Column1]] where you only need one set of [ ]:

 

Html.Table([Column1], {{"ExtractedText",":root"}})

 

That is why PQ was interpreting as a record

See it at work in the attached file (Table1, I've left your original query untouched)

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Background: ADO > Boards SVC > Query > "Open in Power BI" Extension. All the custom fields are exporting as HTML. After performing the aforementioned guidance, which partially works in my case, the null fields are causing Errors. Any advice on a best way to remove Nulls or ignore them? 

mhannah77_0-1698686982524.png

 

Mahesh0016
Super User
Super User

@Anonymous ,

Mahesh0016_0-1672123863054.png

>> If this post helps, please consider accept as solution to help other members find it more quickly.

AlB
Super User
Super User

Hi @Anonymous 

Can you share the query or, ideally, a pbix reproducing the error?

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Anonymous
Not applicable

Hi @AlB Please find the example pbix

 

https://we.tl/t-d4G1yq5Qw7 

 

One note I also tried the "HTML Content" visual but its not working with it as well.

@Anonymous 

You were almost there. I believe there's only a simple error in your code for the custom column. You had:

 

Html.Table([[Column1]], {{"ExtractedText",":root"}})

 

 with  [[Column1]] where you only need one set of [ ]:

 

Html.Table([Column1], {{"ExtractedText",":root"}})

 

That is why PQ was interpreting as a record

See it at work in the attached file (Table1, I've left your original query untouched)

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Anonymous
Not applicable

Thank you @AlB That did the trick. Didnt notice the second pair of [ ] 🙂 

@Anonymous 

Mahesh0016_0-1672133470852.pngMahesh0016_1-1672133496119.png

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.