Forum Discussion
Muesli
6 years agoAdvocate 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) th...
- 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
Piloos
5 years agoAdvocate 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.