cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
jtpiazzamn
Helper I
Helper I

Remove HTML tags from Column

I have a colmn which contains HTML tags as an example: <p><strong>NEW IDEA</strong></p> 

It would be great if we could just PARSE the text out from the HTML. So the end result of this line would be "NEW IDEA" (without the "" of course). 

 

I have seen lots of examples, but can't find one that would work for me. Would I create a new column which have a DAX equation? 

Thanks in advance. HEY Microsoft - you can parse out date from a long date field, can't you parse out html? 

1 ACCEPTED SOLUTION
Shaurya
Memorable Member
Memorable Member

Hi @jtpiazzamn,

 

You can do this transformation in Power Query by extracting the text between delimiters and using advanced options to skip the first occurence of '>'.

 

Screenshot 2022-10-11 021051.jpg

 

I tried this and got "NEW IDEA" (without the "" of course). For your reference:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wiik1MDBOLgBTqRBOcUlRfl46RMTPNVzB08XVESKjjywFFYJqVYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Tags = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Tags", type text}}),
    #"Extracted Text Between Delimiters" = Table.TransformColumns(#"Changed Type", {{"Tags", each Text.BetweenDelimiters(_, ">", "<", 1, 0), type text}})
in
    #"Extracted Text Between Delimiters"

 

Works for you? Mark this post as a solution if it does!

View solution in original post

1 REPLY 1
Shaurya
Memorable Member
Memorable Member

Hi @jtpiazzamn,

 

You can do this transformation in Power Query by extracting the text between delimiters and using advanced options to skip the first occurence of '>'.

 

Screenshot 2022-10-11 021051.jpg

 

I tried this and got "NEW IDEA" (without the "" of course). For your reference:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wiik1MDBOLgBTqRBOcUlRfl46RMTPNVzB08XVESKjjywFFYJqVYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Tags = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Tags", type text}}),
    #"Extracted Text Between Delimiters" = Table.TransformColumns(#"Changed Type", {{"Tags", each Text.BetweenDelimiters(_, ">", "<", 1, 0), type text}})
in
    #"Extracted Text Between Delimiters"

 

Works for you? Mark this post as a solution if it does!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors