Wanna Coffee
Wanna Coffee

Reputation: 2798

Cross-Report Drill through option for Power BI Embedded Link

I have a data source generally population for each street, city, state, and country.

In my source report, I'm showing all visual in the country and state wise. In my target report, I'm showing visual in city and street wise.

I'm adding cross-report drill through to my source report using this document Use cross-report drill through in Power BI Desktop. Which is working fine when I access my report from the Power BI service account.

But when I try to use source report as an Embedded link, this is not working. Is there any limitations in Power BI for these feature (or) Is there any way to achive this?

Please suggest.!

Upvotes: 1

Views: 1623

Answers (1)

mayur_007X
mayur_007X

Reputation: 784

When you embed a report, you specify the exact report to be embedded. Whereas, the cross-report drill through will try to open the target report (not the one, which is embedded i.e. source report), which isn't a problem in Power BI service.

Workarounds:

  1. One workaround is that you can merge the target report into the source report and use the drill-through within the same report
  2. Another workaround is that you can add an option in the context menu to the visual as explained here

In the event listener, store the filters and change the embed URL in embed configuration of the report from source to target. example:

fil = [];
report.on("commandTriggered", function (command) {
  for (i = 0; i < command.detail.dataPoints[0].identity.length; i++) {
     var basicFilter = {
        $schema: "http://powerbi.com/product/schema#basic",
        target: command.detail.dataPoints[0].identity[i].target,
        operator: "In",
        values: [command.detail.dataPoints[0].identity[i].equals],
     }
     fil.push(basicFilter);
  }
  embedConfiguration.embedUrl = "<YOUR REPORT EMBED URL>";
  embedConfiguration.id = "<YOUR REPORT ID>";
  report = powerbi.embed(embedContainer, embedConfiguration);
});

And then apply all the filters on the report on loaded event:

report.on("loaded", function () {
   report.getFilters()
      .then(filters => {
          for (i = 0; i < fil.length; i++) {
             filters.push(fil[i]);
          }
          return report.setFilters(filters);
       });
});

Add a button in the target report to come back to the source report. Use the 'buttonClicked' event listener to capture the click on the back button. On the trigger of this event, change the embed URL of the container to the source report.

Upvotes: 5

Related Questions