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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
FreedaM
New Member

Set Slicer selection to "All" via setSlicerState API method

I am trying to set the state of a slicer to "All" via the setSlicerStateAPI method. I've tried different options including

filters: [{
"$schema": "http://powerbi.com/product/schema#basic",
"target": {table'project'column'Name'},
"filterType": 1,
"operator": "All",
"values": [],
"requireSingleSelection": false
}]

and 

'filters': []

, but no luck.

 

Is there a way to achieve this?

Many thanks in advance

 

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @FreedaM,

I think it looks like you're using Power BI Embedded? In custom visuals, we just need to pass a null filter to clear it. I believe Embedded and Visuals share the same JSON API for filters. Just wondered if you've tried that? 

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

4 REPLIES 4
dm-p
Super User
Super User

Hi @FreedaM,

I think it looks like you're using Power BI Embedded? In custom visuals, we just need to pass a null filter to clear it. I believe Embedded and Visuals share the same JSON API for filters. Just wondered if you've tried that? 

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Hi Daniel,

 

Yes, you are correct that we are using Power BI Embedded. 

That worked. Thank you so much!

 

Best regards,

Freeda

FreedaM
New Member

Hi Xiaoxin,

The slicer is a dropdown list. By default an option is selected and this option is applied to a visual. When I click the selected option to unselect it, the visual shows all data, as no filter is applied.

I'd like to be able to do this programatically, ie. be able to remove the filtering. The dropdown would then also show the dropdown selection as "All".

 

Thanks,

Freeda

Anonymous
Not applicable

HI @FreedaM,

What type of slicer are you working on? Can you please share some more detailed information to help us clarify your scenario?

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.