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
Anonymous
Not applicable

Refresh Direct Query Report on TV without showing it refresh

We have Power BI Report we want to display on our TV and have it auto refresh periodically. I know current solution is to use the google chrome extension to refresh the browser when using direct query report. I was trying to implement similar method using JavaScript and iframe. The solution works, but I want a want to have the report refresh without having the user see the report refresh. My workaround was to JavaScript load my report and then load a new report hidden in the background. Then, once the hidden report is fully rendered, the script would hide the old report and make the new report visible. This would happen every 15 seconds. Unfortunately, the report is not fully loaded/rendered once the swap happens.  Anyone have any suggestions or advice in fixing this?

 

Here is the script I have been using:

<html>
<iframe id="xIfrWidget0" width="100%" height="100%" style="display:none"></iframe>
<iframe id="xIfrWidget1" width="100%" height="100%" style="display:none"></iframe>

<script type="text/javascript">
var ifrNo = 0;
var ifrHidden;
var ifr;

function swap() 
{

ifr = document.getElementById('xIfrWidget' + ifrNo);
ifrNo = 1 - ifrNo;
ifrHidden = document.getElementById('xIfrWidget' + ifrNo);

ifr.onload = null;

ifrHidden.onload = function() {

ifr.style.display = 'none';
ifrHidden.style.display = 'block';


}
// Put in your Power BI Report Link
ifrHidden.src="https://app.powerbi.com/reportEmbed?reportId=..."; 
}

setInterval(function () 
{
swap();
}, 15000)
</script>
</html>

 

The solution is from: http://codecorner.galanter.net/2016/05/05/flicker-free-iframe-refresh/

0 REPLIES 0

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.