Reputation: 975
Since last week when I try to apply a page filter without first setting the report filter I get an error on the console: Unhandled Promise rejection: Failed to execute 'postMessage' on 'Window': TypeError: Cannot read property 'instanceOfIVisualLevel' of undefined could not be cloned...
Using the demo it's possible to test this: https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html#
What is the problem? Is it missing something in the demo?
Upvotes: 1
Views: 1632
Reputation: 4114
It turns out that this is a problem with the Power BI Embedded back-end...
Customers may receive an error while setting or getting page-level filters or visual-level filters using the Power BI embedded javascript API. As a workaround, customers can pass in any filter object in load config. Engineers are investigating the issue. Next update @ 9/10/18 at 9:00AM PDT.
As of the time of this answer however, the issue hasn't been fixed and the Power BI support page states the next update will be on 14th of September (2018), 10:00 PDT.
However, there is quite a simple work-around. Ensure you pass in an empty filter array into the embed configuration object, and everything works fine.
var embedConfig = {
...
filters: [] //Empty array of filters.
};
var $reportContainer = $('#reportContainer');
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
Then you should be able to explicitly set report/page/visual filters in whichever order you like.
Upvotes: 1