web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

You attempted to get an instance of powerbi component associated with element - Portals - Power BI

(0) ShareShare
ReportReport
Posted on by 50

Hi All,

 

I am getting the below error when i try to use Power BI JS to hide some pages and filters of power bi report in power app portals.

The report is displaying perfectly but the javascript is not working and giving error in console.

Uncaught Error: You attempted to get an instance of powerbi component associated with element

title="Power BI report"></iframe> but there was no associated instance.

 

 pastedimage1638326135400v2.png

 

Below is my code 

{% assign forums_sm = sitemarkers["Forums"] %}

<html>

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

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

 

{% powerbi authentication_type:"AAD" path:"MyPowerBIURL" %}

 


</html>

 

<script>

$(window).load(function() {
// get div container for powerbi report
var embedContainer = $(".powerbi")[0];

// get reference to the embedded report
var report = powerbi.get(embedContainer);

// register a function to execute when report will finish loading
report.on("loaded", function(){
// update existing setting of the reports
// you can disable only one page or both at the same time
report.updateSettings({
panes: {
filters :{
visible: false
},
pageNavigation:{
visible: false
}
}
}).catch(function (errors) {
console.log(errors);
});
})
});
</script>

 

 

Please help how i can get ride of this error.

 

I exactly followed same steps mentioned in msdn link. Please see link here

 

https://docs.microsoft.com/en-us/powerapps/maker/portals/admin/add-powerbi-report

 

Thank you

I have the same question (0)
  • Suggested answer
    Nya Profile Picture
    29,060 on at

    Hi,

    Please refer to the following documentation.

    Embed a report in a secure portal or website - Power BI | Microsoft Docs

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans