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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.