Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
semptra
Frequent Visitor

Deselecting report slicer does not propagate "dataSelected" event

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:

  1. User opens "Report A"
  2. User selects value "Value A" on the Slicer
  3. User switches to the "Report B"
  4. User deselects "Value A" on the Slicer

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:

semptra_0-1683129284031.png

 

By "clearing" the slicer, I mean clicking on the eraser button (clearing selections):

semptra_1-1683129329935.png

 

1 ACCEPTED SOLUTION
semptra
Frequent Visitor

1 REPLY 1
semptra
Frequent Visitor

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.