0

Pre-requisites:
1. Atleast 1 hidden filter on the PowerBI report and embed the report in web app using PowerBI-Embedded Javascript library.

Scenario:
1. Add a dynamic filter to power bi report (through embedded javascript library)
2. Capture a bookmark from the applied filter
3. Now, remove the above applied filter and re-apply another filter on the report.
4. Apply the captured bookmark, now the report is broken.

Details:
I have embedded the powerbi reports into our web application and applying dynamics filters (in locked mode) based on the logged in user's roles. When I apply a dynamic filter, capture the bookmark and save it to a variable. Now, apply another filter and apply the bookmark. At this stage the issue is, other filters on the report is also broken. Meaning, if there are any pre-filters applied in locked mode also getting reset to show All. This implementation was working earlier, but seems to be broken now. Any pointers around that would be of great help as this is breaking in our production environment. Below, i have given the snapshot with console logs for better understanding.

enter image description here

2 Answers 2

3

First of all, if you need to show data based on signed-in user, you should opt for RLS.

In your case, when you are applying filters using Power BI Embedded Javascript library, first you need to get all the applied filters, add you filter to the array and then apply the updated filters array to the report. Here's a code snippet to apply filters:

var basicFilter = {
    $schema: "http://powerbi.com/product/schema#basic",
    target: <target table here>,
    operator: "In",
    values: [<values go here>],
 }
report.getFilters()
  .then(filters => {
      filters.push(basicFilter);
      return report.setFilters(filters);
   });

See here for more details.

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

Comments

0

I contacted Microsoft support for the the above issue and they agreed it is a bug from the product and they will be fixing it.

2 Comments

Can you provide a link to any article or docs for the issue/bug?
Unfortunately, I don't have the link to the issue. This one was with my previous client and struggled to get the expected result. Then I raised a support ticket from the Microsoft portal, also we got some direct contacts from Microsoft team and discussed over the teams meeting and screen sharing. Then, internally they discussed and mentioned that, they will fix this bug. But they were not sure about the timeline/deadline. Its a little tricky scenario, please read the description carefully.

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.