Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
We are using powerbi-client-angular (https://github.com/microsoft/powerbi-client-angular) to embed Power BI reports for our customers.
We have 2 reports - "Report A" and "Report B". Both of them have a slicer with the same name and target (filters data in the same table and column). Embedding code looks something like this:
HTML:
<powerbi-report
[embedConfig]="reportEmbedConfig"
[eventHandlers]="reportEventHandlers">
</powerbi-report>
TypeScript:
const reportEmbedConfig = {
type: 'report',
tokenType: models.TokenType.Embed,
accessToken: null,
};
const reportEventHandlers = new Map<string, EventHandler | null>([
['loaded', async (event) => await this.onReportLoaded(event)],
['dataSelected', (event) => this.onReportDataSelected(event)]
]);
Parent component than uses inputs for "ReportName" and "Slicers" based on which the proper report with the slicers is loaded:
this.reportName$.pipe(
tap(() => this.isReportLoaded = false),
switchMap(newReportName => getPowerBIReportEmbedParameters(newReportName)),
takeUntil(this.onDestroy$)
).subscribe(embedParameters => {
const reportSlicers = this.getReportSlicersConfiguration(this.reportName);
this.reportEmbedConfig = {
...this.reportEmbedConfig,
embedUrl: embedParameters.embedItem.embedUrl,
accessToken: embedParameters.embedToken.token,
slicers: reportSlicers
};
});
So, the user can switch between the reports, and the Slicer should be transferred from one report to the other.
However, in the following scenario, we have an issue:
When the user selects value in step 2, "dataSelected" event is property triggered. However, on the step 4, after deselecting the value, "dataSelected" event is not triggered. If the User instead selects another value on the Slicer and then tries deselecting again, the "dataSelected" event is triggered property. It's just not working for the first time. Note that clearing the Slicer by pressing the eraser button works just fine.
What's going on there? Is there something wrong on our side or on the Power BI side.
Update.
By saying "deselect" I mean clicking on the already selected value in the slicer, for example in this case clicking on the "Abbas MA-03) value:
By "clearing" the slicer, I mean clicking on the eraser button (clearing selections):
Solved! Go to Solution.
Please close this since I've created an easier repro steps for this here - https://community.powerbi.com/t5/Developer/quot-dataSelected-quot-event-not-triggered-on-deselect
Please close this since I've created an easier repro steps for this here - https://community.powerbi.com/t5/Developer/quot-dataSelected-quot-event-not-triggered-on-deselect
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 |