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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.