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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I have a report with a categorical slicer. This slicer has "single select" checked and renders as a "one selection" visual:
However, when I use the client API in embed mode, when I get this slicer and then run `const state = await slicer.getState()`
the `state.filters[0].requireSingleSelection` is always set to false whatever the check status on my report.
Is it a known issue or is it because I get the wrong attribute?
Hi @FrançoisD ,
Please review the following links, hope they can help get the expected result...
Slicers · microsoft/PowerBI-JavaScript Wiki · GitHub
let state = await visual.getSlicerState();// Get the list of visuals from the report
report.getPages()
.then(function(pages) {
return pages[0].getVisuals();
})
.then(function(visuals) {
// Find the slicer visual by name or other properties
let slicer = visuals.find(function(visual) {
return visual.type === 'slicer' && visual.name === 'SlicerVisualName';
});
// Get the state of the slicer
return slicer.getSlicerState();
})
.then(function(slicerState) {
// Access the selected value
let selectedValue = slicerState.targets[0].target;
console.log('Selected Value:', selectedValue);
})
.catch(function(errors) {
console.error(errors);
});
Best Regards
Hello,
Thanks for your reply but, it does not answer my question at all.
I am already using the getSlicerState function and I can already get the selected value and even set it.
My issue is that I cannot programmatically make the difference between a slicer that only accept one selected value and a slicer that accept many because the "requireSingleSelection" boolean is always set to "false" in the state.filters attribute.
Regards
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |