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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Slicer Hierarchy - Single Select Per Category

Hello,

 

I have a situation in PowerBI where I am trying to create a hierarchical slicer that allows the user to select only one item from each of the hierarchies.

 

The typical single select feature only allows me to select one item even if items are in different hierarchies. I also looked at the user created 'HierarchySlicer' which limits to selection of the leaves only (closer to what I want), but I would want to be able to select only one leaf per category.

 

An example of what I am talking about it below. In which I would want a user to be able to select only one of the options from 'EQ', but also select or not select one of the options in 'CS' and 'WS' in addition to thier selection in 'EQ'

justin_jones_0-1658415036329.png

 

Thanks!

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Try formula like below:

M1 = SELECTEDVALUE('Table'[Category])
M2 = SELECTEDVALUE('Table'[Category])

result =
VAR combine =
    CALCULATE (
        MAX ( 'Table'[Category] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Category] = [M1] )
    ) & "+"
        & CALCULATE (
            MAX ( 'Table'[Category] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Category] = [M2] )
        )
RETURN
    IF ( combine IN { "B+C", "B+H", "G+C", "G+H" }, 1, 0 )

vhenrykmstf_0-1659689997867.png

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Try formula like below:

M1 = SELECTEDVALUE('Table'[Category])
M2 = SELECTEDVALUE('Table'[Category])

result =
VAR combine =
    CALCULATE (
        MAX ( 'Table'[Category] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Category] = [M1] )
    ) & "+"
        & CALCULATE (
            MAX ( 'Table'[Category] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Category] = [M2] )
        )
RETURN
    IF ( combine IN { "B+C", "B+H", "G+C", "G+H" }, 1, 0 )

vhenrykmstf_0-1659689997867.png

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Anonymous You need to use CNTRL keyword and then you can select multiple values in a hierarhial slicer like below

 

Mohan1029_0-1658416412445.png

 

Anonymous
Not applicable

Hi Mohan,

 

Thanks for your comment, but I am not sure you understood the question. In your example I would want the user to only be able to select a combination of either B or G from Prof1 and either C or H from Prof2, but not a combination of (B+G or C+H). The only acceptible selections would be B+C, B+H, G+C, or G+H.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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