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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
inna_sysco
Helper II
Helper II

Decoding HTML symbols into actual symbols in Power BI

Hello everyone!
I am trying to load HTML data (special characters, links, etc.) from Azure Database to Power BI.
During my research, I found many suggestions on how to do this, but, unfortunately, none of them work for me ...
Am I missing something?
The last solution I tried  - https://stackoverflow.com/questions/65105454/decoding-html-symbol-decimal-numbers-into-actual-symbol...
But after all, I have such a result:

 

inna_sysco_0-1614851368207.png

 

 
 

Any suggestions?

I will be very grateful for any ideas!

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @inna_sysco 

 

Download sample PBIX file with solution

 

The problem here is that the symbol has been 'double-encoded'.  For example the code for the HTML symbol less than < is &lt; but that has been encoded as &amp;lt; because the & sign itself has been encoded as &amp; 

To fix this you need to Replace Values on the column to switch &amp; back to just &

html1.png

html2.png

 

Then you can use Html.Table to decode

html3.png

 

Here's the full example query that you can find in my PBIX file above

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wiik1MDAyS8wtsM4psS5A8NJLrJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [VALUE = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,"&amp;","&",Replacer.ReplaceText,{"VALUE"}),
    #"Added Custom" = Table.AddColumn(#"Replaced Value", "Custom", each Html.Table([VALUE],{{"HtmlDecoded",":root"}})),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"HtmlDecoded"}, {"HtmlDecoded"})
in
    #"Expanded Custom"

 

Regards

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
PhilipTreacy
Super User
Super User

@inna_sysco 

You're welcome.

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

Hi @inna_sysco 

 

Download sample PBIX file with solution

 

The problem here is that the symbol has been 'double-encoded'.  For example the code for the HTML symbol less than < is &lt; but that has been encoded as &amp;lt; because the & sign itself has been encoded as &amp; 

To fix this you need to Replace Values on the column to switch &amp; back to just &

html1.png

html2.png

 

Then you can use Html.Table to decode

html3.png

 

Here's the full example query that you can find in my PBIX file above

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wiik1MDAyS8wtsM4psS5A8NJLrJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [VALUE = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,"&amp;","&",Replacer.ReplaceText,{"VALUE"}),
    #"Added Custom" = Table.AddColumn(#"Replaced Value", "Custom", each Html.Table([VALUE],{{"HtmlDecoded",":root"}})),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"HtmlDecoded"}, {"HtmlDecoded"})
in
    #"Expanded Custom"

 

Regards

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


@PhilipTreacy , thank you very much for your answer and detailed instructions!
This completely solved my problem!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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