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
Nadim1313
New Member

ISINSCOPE in a Matrix Hierarchy

Hi,

 

I was trying to test if I can rank rows based on their hierarchy level group using the isinscope function in a switch statement.

 

Initially I tested the following:

 

Test is in scope =
SWITCH(
    TRUE(),
    ISINSCOPE(DimProductCategory[ProductCategoryName]),
    1,
    ISINSCOPE(DimProductSubcategory[ProductSubcategoryName]),
    2
    )
 
However the Matrix is returning 1 for every level, whereas I expected a 2 in the subcategory level.
 
Any idNadim1313_0-1704913573119.pngea what the issue could be?
 
 
I also tried it using a date table so that I am basing the query on a single table using year and quarter, but also no success.
 
Thanks in advance!
1 ACCEPTED SOLUTION
Idrissshatila
Super User
Super User

Hello @Nadim1313 ,

 

you should in reverse order. So if level one is above in a visual and level 2 is below, then use Level2, level 1

Idrissshatila_0-1704914473656.png

Test is in scope = 
SWITCH(
    TRUE(),
    ISINSCOPE(DimProductSubcategory[ProductSubcategoryName]),
    2,
    ISINSCOPE(DimProductCategory[ProductCategoryName]),
    1
    )

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Nadim1313
New Member

Great thanks! Works perfectly now

Idrissshatila
Super User
Super User

Hello @Nadim1313 ,

 

you should in reverse order. So if level one is above in a visual and level 2 is below, then use Level2, level 1

Idrissshatila_0-1704914473656.png

Test is in scope = 
SWITCH(
    TRUE(),
    ISINSCOPE(DimProductSubcategory[ProductSubcategoryName]),
    2,
    ISINSCOPE(DimProductCategory[ProductCategoryName]),
    1
    )

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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