Forum Discussion
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.
i am not able to read the current slicer state, what can i do/try?
- Anonymous6 years ago
Hi Muesli
Looks like the native hierarchy slicer is not supported for use with 'GetSlicerState' yet.
https://github.com/microsoft/PowerBI-JavaScript/wiki/SlicersI am not aware of any workaround - so you might have to settle for another slicer type.
Cheers, Matt
4 Replies
- PiloosAdvocate 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://docs.microsoft.com/en-us/javascript/api/overview/powerbi/control-report-slicers#limitations
Once I have more info, I 'll let you know.
- AnonymousNot applicable
Hi Muesli
Looks like the native hierarchy slicer is not supported for use with 'GetSlicerState' yet.
https://github.com/microsoft/PowerBI-JavaScript/wiki/SlicersI am not aware of any workaround - so you might have to settle for another slicer type.
Cheers, Matt - brnyzaRegular 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?- PiloosAdvocate I
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... 🙂