How to de-select the only child node for Parent in Hierarchy slicer and leave parent node selected?
We have Group/Sector and Division in our hierarchy. By default when a parent node is selected, the child nodes are automatically selected. I have measures that determine when user has clicked on Parent level or child level by comparing the count of children with # of selected children for a given parent. The issue we run into is when a parent only has one child. There’s no way for me to determine if Parent box is selected or child box since both gets selected, and there’s no way to de-select the only child by using the ctrl-click. I’ve also looked at 3rd party slicers but can’t find the correct solution. The ideal solution would be to de-select the only child and just have the parent node selected. The easiest workaround we could think is to add a dummy child with a dot ( . ) under parent nodes with only single child.
According to you description, if you want to determine when user has clicked on Parent level or child level ,you could use DISTINCTCOUNT(‘parent’) and DISTINCTCOUNT(‘child’) to distinguish difference.
However, when a parent only has one child. If you click one ,another must be clicked. because Only leaves (lowest items) can be selected .So they were all chosen. In addition , The content you selected the parent node and the content you selected its all child nodes are the same.
If you only want a parent node's name, you can use SELECTEDVALUE() function.
For example, if you want to whether the parent is selected, you could create a measure: