Reputation: 2798
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
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:
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