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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
kemaley
Frequent Visitor

undefined

Hi everybody, I am having some trouble with matrix. How can I check if the top level or a lower level is selected in a matrix hierarchy. I cannot use the isinscope function because I only want to process the selected item, not every item at the same level in the matrix.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@kemaley 

Regarding the issue you raised, my solution is as follows:

1.You can create other measures that return values that represent hierarchy levels based on what is selected, here is my example:

vlinyulumsft_0-1715220882766.png

Use an IF statement to check if you are at this hierarchy level and, based on your situation, use the ISFILTERED() function as an alternative technique when the ISINSCOPE() function is not available:

 

HierarchyLevel = 
IF(
    ISFILTERED('LEVEL'[class3]),
    "class3",
    IF(
        ISFILTERED('LEVEL'[class2]),
        "class2",
        IF(
        ISFILTERED('LEVEL'[class1]),
        "class1",
        "None"
    )
    )
)

 

Here's my final result, which I hope meets your requirements.

vlinyulumsft_1-1715220920120.png

vlinyulumsft_2-1715220936362.png

vlinyulumsft_3-1715220947954.png

vlinyulumsft_4-1715220955309.png

2.You can also look directly at the icons below the matrix visualization to determine, if you have expanded the hierarchy:

vlinyulumsft_0-1715221037577.png

 

3.Here is the relevant documentation:

ISFILTERED function (DAX) - DAX | Microsoft Learn

Drill mode in the Power BI service - Power BI | Microsoft Learn

Best Regards,

Leroy Lu

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

2 REPLIES 2
kemaley
Frequent Visitor

It works! Thank you so much.

Anonymous
Not applicable

Hi,@kemaley 

Regarding the issue you raised, my solution is as follows:

1.You can create other measures that return values that represent hierarchy levels based on what is selected, here is my example:

vlinyulumsft_0-1715220882766.png

Use an IF statement to check if you are at this hierarchy level and, based on your situation, use the ISFILTERED() function as an alternative technique when the ISINSCOPE() function is not available:

 

HierarchyLevel = 
IF(
    ISFILTERED('LEVEL'[class3]),
    "class3",
    IF(
        ISFILTERED('LEVEL'[class2]),
        "class2",
        IF(
        ISFILTERED('LEVEL'[class1]),
        "class1",
        "None"
    )
    )
)

 

Here's my final result, which I hope meets your requirements.

vlinyulumsft_1-1715220920120.png

vlinyulumsft_2-1715220936362.png

vlinyulumsft_3-1715220947954.png

vlinyulumsft_4-1715220955309.png

2.You can also look directly at the icons below the matrix visualization to determine, if you have expanded the hierarchy:

vlinyulumsft_0-1715221037577.png

 

3.Here is the relevant documentation:

ISFILTERED function (DAX) - DAX | Microsoft Learn

Drill mode in the Power BI service - Power BI | Microsoft Learn

Best Regards,

Leroy Lu

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

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors