Disable The Slicer Selection In The PowerBI Embedded Report Using ReactJS

86 views Asked by At

I have embedded the PowerBI report using the ReactJS. There is one slicer/dropdown in it. I want to disable that slicer/dropdown programmatically in the ReactJS.

This is my code to get that visual.

window.report.getPages().then(pages => {
    pages[0].getVisuals().then(visuals => {
      const clientSlicerVisual = visuals.find(visual => visual.name === "123456789");
    });
});

I have tried the below way from the internet to disable the slicer. But it's not working.

clientSlicerVisual.setSlicerState({ filters: [] });

Any other ways to disable the slicer programatically?

1

There are 1 answers

0
David Browne - Microsoft On

Visuals don't have a "disabled" state, but you can simply remove the visual using the embedded authoring API.