1

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#

  1. Sample Report
  2. Click "Run"
  3. Click "Interact"
  4. Go to "Filters & Slicers" and click "Set page filters"
  5. Click run to apply the page filter
  6. Check browser console

What is the problem? Is it missing something in the demo?

6
  • I can confirm the behaviour you are setting in the demo. Commented Sep 10, 2018 at 6:08
  • This is also something that has recently started with my own application; although I haven't tested the order of page filter/report filter. Commented Sep 10, 2018 at 6:31
  • You might want to look at this discussion on the Power BI forums, and help us try and get Microsoft to do something, since it seems that they have broken it. community.powerbi.com/t5/Developer/… Commented Sep 10, 2018 at 6:32
  • Also take a look at stackoverflow.com/questions/52122011/… Commented Sep 10, 2018 at 6:32
  • 1
    So far If I set the report filter before setting the page filter it seems to work fine.. But this was not necessary a month ago.. Commented Sep 10, 2018 at 8:18

1 Answer 1

1

It turns out that this is a problem with the Power BI Embedded back-end...

https://community.powerbi.com/t5/Developer/Problem-using-page-getFilters/m-p/511911/highlight/true#M15792

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.