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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Lixin
Regular Visitor

HTML not rendering in HTML Content visual

I'm using HTML Content visual.

I created a measure which embeded my HTML code:

``

HTML = "
<!DOCTYPE html>
<html lang=""en"">
<head>
  <meta charset=""UTF-8"">
  <meta name=""viewport"" content=""width=device-width, initial-scale=1.0"">
  <title>Document</title>
  <style>
    .container{
      display: flex;
      justify-content: center;
    }
    .opp-name{
      color:#d70927;
      font-family: Arial, Helvetica, sans-serif;
    }
  </style>
</head>
<body>
  <div class=""container"">
    <p class=""opp-name"">"&SELECTEDVALUE('Opportunité'[Name])&"</p>
    " & SELECTEDVALUE('Opportunity Feed'[Body]) & "
  </div>
</body>
</html>
"

``

'Opportunité'[Name] renders properly, 'Opportunity Feed'[Body] is not rendering.

In 'Opportunity Feed'[Body], it contains HTML tags and content. For example: <p>Email relance sent à Ingrid &gt;&gt; Reponse</p><p>Je reviens vers vous</p>

If I just drop 'Opportunity Feed'[Body] alone in HTML Content visual, it renders properly.

2 ACCEPTED SOLUTIONS
KerKol
Power Participant
Power Participant

Have you checked the granuality? Maybe there are duplicates? 

KerKol_0-1733659077919.png

If you change the SELECTEDVALUE of 'Opportunity Feed'[Body] to MAX of 'Opportunity Feed'[Body] --- you should see it return text?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

KerKol
Power Participant
Power Participant

It's possible you could use CONCATENATEX in your DAX





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
KerKol
Power Participant
Power Participant

Have you checked the granuality? Maybe there are duplicates? 

KerKol_0-1733659077919.png

If you change the SELECTEDVALUE of 'Opportunity Feed'[Body] to MAX of 'Opportunity Feed'[Body] --- you should see it return text?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




You are right. There are duplicate values that I didnt notice: 

Lixin_0-1733741236155.png

In this case, I would like to display both values like this:

30/10/2024 11:15:54

<p> AS Lorea Belette....</p>

17/10/2024 13:34:30

<p> Email relance colle....</p>

 

I'm thinking that I could use JavaScript to make an array and then use HTML to display this in the iframe.

Does this visual also render JS?

KerKol
Power Participant
Power Participant

No it doesn't. Could you create an index field? it's hard to advise without seeing what you are trying to build...

KerKol_0-1733741732756.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




KerKol
Power Participant
Power Participant

It's possible you could use CONCATENATEX in your DAX





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




lbendlin
Super User
Super User

Most likely it contains too many tags ( like <body>  etc).  See if you can clean that up, or if you can isolate it in its own iframe.

You mean in my 'Opportunity Feed'[Body] column there might be <body> tag?

There isn't any <body> tag, but in some records there are a lot of <p> tag.

To test your solution, I created a new column 'Opportunity Feed'[Test]. In this column, all the records are "<p>Test</p>". 

When I changed my measure from  SELECTEDVALUE('Opportunity Feed'[Body]) to SELECTEDVALUE('Opportunity Feed'[Test]), "Test" is rendered in the iframe, but opportunity name is not rendering any more.

This is really odd.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors