Forum Discussion

FreedaM's avatar
FreedaM
New Member
4 years ago
Solved

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

 

4 Replies

    • FreedaM's avatar
      FreedaM
      New Member

      Hi Daniel,

       

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

      That worked. Thank you so much!

       

      Best regards,

      Freeda

  • 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