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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Hougaard77
Regular Visitor

Embedded report showing old rendering

I am using a filter on my Power BI embedded report to select the customer number to show a particular customer his data. The filter is set using JavaScript according to the tutorials online.

 

However, when opening the report, it often shows another customer's data until a new report is loaded. It seems that the old rendering is saved. But obviously I need the report to start out blank and then apply the filter instead of showing the wrong data and revealing one customers report to the other.

 

How can I make that happen?

 

Best regards,

 

Erik

5 REPLIES 5
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Hougaard77,

 

Where did you set the filter, in the onload event, or other event?

 

The Power BI Javascript should support setting filter when embedding without the rendering issue. Following is a similar thread for reference: https://community.powerbi.com/t5/Developer/how-to-create-custom-filters-for-power-bi-embedded-report...

The Power BI Javascript support set filter when embedding. Check this wiki. You can find a more integrated live demo by clicking Custom Filter Pane.

 

A simple demo I use to test for your reference.

 

<html>

 <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script>  
 <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js""></script>

<script type="text/javascript">
var embedConfiguration = {
    type: 'report',
    accessToken: 'token',
    embedUrl: 'embedURL' 
}; 

var report;

window.onload = function () { 

var $reportContainer = $('#reportContainer');
 
 report= powerbi.embed($reportContainer.get(0), embedConfiguration);
 
 
 var Filter1 = {
$schema: "http://powerbi.com/product/schema#advanced",
target: {
table: "Table1",
column: "T1id"
},
logicalOperator: "OR",
conditions: [
{
operator: "Contains",
value: "id1"
} 
]
}
 
report.on('loaded', event => {
  report.getFilters()
    .then(filters => {
	
      filters.push(Filter1); 
return report.setFilters(filters); }); }); } function reloadreport(){ var $reportContainer = $('#reportContainer'); powerbi.embedNew($reportContainer.get(0), embedConfiguration); }; </script> <div id="reportContainer"></div> </html>


 

Regards

Hi,

 

First of all, I tried specifying the filter in the embedConfiguration

 

Then I applied it in the loaded event which causes the same behaviour: Data from the previous rendering is shown until a refresh has been completed (takes 5 seconds or so)

 

Finally I tried applying the filter in the onload event but that seems to cause the filter to be completely ignored after switching between pages in the report.

 

So, unfortunately the issus is not solved. I event tried applying a "front page" to my report and setting navContentPaneEnabled to false until the rendered event would set it true. But that event fires as soon as the front pages has been rendered and the other pages still contain data that does not match the filter.

 

Looking forward to you advice,

 

Erik

Hello Erik,

Have you found any solution? i tried to put cache control = No. but still the iframe initially displays old data for fraction of 5 seconds and then filters based on the criteria chosen.

Hi,

 

Sorry about the late reply. I was notified about your question only now - 2 months after you posted it 🙂

 

I did not manage to find a solution. In this particular project we decided to build our reporting around chartJS instead.

 

Best regards,

 

Erik

Any update on this? Is the issue resolved from Microsoft?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.