cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Muesli
Advocate I
Advocate I

Unable to getSlicerState from Tuple Slicer (Uncaught TypeError)

Hello,

 

i am trying to get the SlicerState from a Tuple-Slicer so that i can store the user-selection.

 

when child elements are selected and also top/fahter-level elements (check screenshot) the powerbi-client will thrown an error.

 

2020-07-20 14_10_43-Markt und Wettbewerb Test.png

 

i am not able to read the current slicer state, what can i do/try?

1 ACCEPTED SOLUTION
MattCalderwood
Responsive Resident
Responsive Resident

Hi @Muesli 

Looks like the native hierarchy slicer is not supported for use with 'GetSlicerState' yet.
https://github.com/microsoft/PowerBI-JavaScript/wiki/Slicers

 

I am not aware of any workaround - so you might have to settle for another slicer type.
Cheers, Matt

View solution in original post

4 REPLIES 4
brnyza
Regular Visitor

I'm getting the same error "get and set slicer state are not supported for hierarchy slicer".
PowerBI still doesn't have a workaround?

Nope.  The latest news I got a few weeks ago from the Power BI support team: it is on the backlog of the product team, but no ETA can be given... 🙂

Piloos
Advocate I
Advocate I

For some reason, it does return tuple in rare occassion.  But this is not consistent, usually it throws the error...

 

Below is the result of getSlicerState() that I sometimes get...

state: {
filters: [
{"$schema":"http://powerbi.com/product/schema#tuple","filterType":6,"operator":"In","target":[{"column":"FinancialYear","table":"Fact_TransactionLines"},{"column":"FinancialYearPeriod","table":"Fact_TransactionLines"}],"values":[[{"value":"2021"},{"value":"2021-P01"}],[{"value":"2021"},{"value":"2021-P02"}]]}
], 
targets: [
{"column":"FinancialYear","table":"Fact_TransactionLines"}
]
}, 

 

Additional links:

https://community.powerbi.com/t5/Issues/getSlicerState-error/idc-p/1692319#M64661

https://community.powerbi.com/t5/Issues/getSlicerState-not-working-for-slicers-with-hierarchy/idi-p/...

https://docs.microsoft.com/en-us/javascript/api/overview/powerbi/control-report-slicers#limitations

 

Once I have more info, I 'll let you know.

MattCalderwood
Responsive Resident
Responsive Resident

Hi @Muesli 

Looks like the native hierarchy slicer is not supported for use with 'GetSlicerState' yet.
https://github.com/microsoft/PowerBI-JavaScript/wiki/Slicers

 

I am not aware of any workaround - so you might have to settle for another slicer type.
Cheers, Matt

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.