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.
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.
Is there any other workaround or solution?
Hi @mehul26 ,
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:
selectparent = SELECTEDVALUE(Table1[Country])
Reference:
https://azurebi-docs.jppp.org/powerbi-visuals/hierarchy-slicer.html?tabs=docs%2Cdocs-open
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@mehul26 Another thought here is if ISINSCOPE might be of use. ISINSCOPE function (DAX) - DAX | Microsoft Docs
@mehul26 Sharing formulas may help. Question, why does it matter which is selected, parent/child, for parents with only 1 child?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |