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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors