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?

Hyyan Abo Fakher
  • 3,497
  • 3
  • 21
  • 35
António
  • 975
  • 1
  • 12
  • 31
  • I can confirm the behaviour you are setting in the demo. – James Webster Sep 10 '18 at 06: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. – James Webster Sep 10 '18 at 06: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. https://community.powerbi.com/t5/Developer/Problem-using-page-getFilters/td-p/504821/jump-to/first-unread-message – James Webster Sep 10 '18 at 06:32
  • Also take a look at https://stackoverflow.com/questions/52122011/failed-to-execute-postmessage-on-window-googletagmanager/52223341#52223341 – James Webster Sep 10 '18 at 06:32
  • Thank you for the links. I see everyone is having the same problem. – António Sep 10 '18 at 08:15
  • 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.. – António Sep 10 '18 at 08:18

1 Answers1

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.

James Webster
  • 4,046
  • 29
  • 41