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
Anonymous
Not applicable

SetSlicerState not working for native slicers with hierarchical fields

Hello, 
I have observed that setSlicerState is not working with native slicers with hierarchial filters. 
Please look at the following examples: 
I have set up 2 slicers. One has city as fields and other has city from the geography hierarchy as the field. 
withHierarchy.pngwithoutHierarchy.png

I am able to set the slicer state through JS API for native slicers without hierarchial fields. 
But for the withHierarchy slicer, I receive "FilterTargetDoesNotMatchSlicerTarget" error. 
Following are the snippets and screenshots for the same. 
3.png

10.png

Looking at the slicer state I can see that the state for withHierarchy has different target than one in present for it's filters. 

1.png2.png
If I update the filter target to be the same as slicer state target the filter is applied but the value is not correctly displayed on the slicer. 
Here you can see the data is filtered but the slicer still has ALL displayed. And clicking on dropdown I can see all the values rather than just 1 value which was passed to it in slicer state but the actual data is indeed sliced as you can see from the without Hierachy slicer value. 
11.png
Updating the slicer set to be filter target doesn't work as expected. 

0 REPLIES 0

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.