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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
rstrickley0308
New Member

Dynamic HTML Table Based on Slicer Selection in Power BI

Hello Power BI Community,

 

I'm facing a challenge in Power BI that I hope to get some assistance with. My goal is to create a dynamic HTML table that updates based on the user's selection from a slicer. The table needs to display various details of a selected program, such as Division, Line of Business, Industry, etc., and change its displayed content in real-time when a different program is selected.

 

Here is the DAX measure I've been working with to create the dynamic HTML content:

 

Dynamic HTML Content = 
VAR SelectedProgram = SELECTEDVALUE('Program Names'[Program], "No program selected")
RETURN 
    "<div style='font-family: Arial; font-size: 14px; color: #333;'>" & 
    "Selected Program: <strong>" & SelectedProgram & "</strong>" & 
    "</div>"

This measure is supposed to create an HTML visual that updates to show the currently selected program. However, I have not found a way to render this HTML content dynamically within Power BI, as there seems to be no tool or feature in the Power BI marketplace that supports such functionality. When selecting a program name from the slicer I've created I get the following display:

 

rstrickley0308_1-1708979072726.png

 

This is true no matter which program I select.

 

I've looked into alternatives, such as Python scripting, but this does not provide the aesthetic advatages that HTML does.

 

I am reaching out to see if anyone has encountered and overcome a similar issue or if there are custom visuals available that can achieve this. I am also open to any suggestions for workarounds that could allow for dynamically updating HTML content based on slicer selections. Atlernatively, if there are means of reproducting my table using another marketplace extension, that would also be a suitable outcome.

 

Any advice or guidance would be greatly appreciated. Thank you for taking the time to help.

 

Best regards,

 

Rob

1 ACCEPTED SOLUTION

After extensive troubleshooting and community advice, I've pinpointed the root cause of the HTML rendering issues I encountered in Power BI. Initially, my approach involved manually creating a data table via the "Enter Data" option, followed by inserting placeholder data. Subsequently, I aimed to integrate dynamic HTML content by adding a DAX formula within a new calculated column in the Column Tools section.

However, this method led to challenges, particularly with HTML content not updating dynamically in response to filters. The crucial insight came from understanding the distinction between calculated columns and measures in Power BI. Unlike calculated columns, which are static and computed during data refresh, measures are dynamic and recalculated based on the current context, including any applied filters.

The breakthrough fix involved shifting from using calculated columns to employing measures for embedding HTML content. This adjustment allowed the HTML content to become responsive and update dynamically in accordance with the applied filters, thereby solving the rendering issues I was facing.

This experience underscores the importance of selecting the appropriate Power BI feature (measures over calculated columns) for specific tasks, especially when aiming to incorporate dynamic elements like HTML content.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Apologies for the oversight in my initial query. Currently, I'm utilizing the HTML content feature within Power BI and have also experimented with the HTML Viewer. As of now, I have not delved into utilizing D3.js for this purpose, primarily due to its perceived complexity compared to other available options. However, I am open to exploring it further. If you believe that D3.js could offer a more efficient solution to my challenge, I am eager to learn and would appreciate any guidance or resources you might recommend for getting started. Thank you for considering my situation and for any advice you can offer.

Anonymous
Not applicable

Hi @rstrickley0308 

 

I tried with two custom visuals. Both work. But they are probably not free of charge. 

vjingzhanmsft_1-1709017738916.png

There are several html custom visuals you may have a look at. 

vjingzhanmsft_2-1709017817360.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

After extensive troubleshooting and community advice, I've pinpointed the root cause of the HTML rendering issues I encountered in Power BI. Initially, my approach involved manually creating a data table via the "Enter Data" option, followed by inserting placeholder data. Subsequently, I aimed to integrate dynamic HTML content by adding a DAX formula within a new calculated column in the Column Tools section.

However, this method led to challenges, particularly with HTML content not updating dynamically in response to filters. The crucial insight came from understanding the distinction between calculated columns and measures in Power BI. Unlike calculated columns, which are static and computed during data refresh, measures are dynamic and recalculated based on the current context, including any applied filters.

The breakthrough fix involved shifting from using calculated columns to employing measures for embedding HTML content. This adjustment allowed the HTML content to become responsive and update dynamically in accordance with the applied filters, thereby solving the rendering issues I was facing.

This experience underscores the importance of selecting the appropriate Power BI feature (measures over calculated columns) for specific tasks, especially when aiming to incorporate dynamic elements like HTML content.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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