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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
murphm6
Helper II
Helper II

IsInScope() and Matrix Visual Question

Hey all,

 

Is there a way to use ISINSCOPE() to show a value in a matrix function for only the middle level of the hierarchy? In my case, I want only want the ASP and Multi-YearMonthAvg columns to only show at the highlighted level and not below. There is a level of hierarchy above the highlighted which I've hidden for anonymity, but I don't want the value to appear there either. 

 

murphm6_0-1669843203753.png

 

 

Can anyone help?

1 ACCEPTED SOLUTION

Hi @murphm6 ,

Please update the formula of measure [] and [] as below,  you can find the details in the attachment.

ASP =
IF (
    ISINSCOPE ( 'Table'[Item] ) && NOT ( ISINSCOPE ( 'Table'[Sub Item] ) ),
    SUM ( 'Table'[ASP Value] ),
    BLANK ()
)
Multi-Year Month Avg =
IF (
    ISINSCOPE ( 'Table'[Item] ) && NOT ( ISINSCOPE ( 'Table'[Sub Item] ) ),
    AVERAGE ( 'Table'[Mult-Year Month Value] ),
    BLANK ()
)

yingyinr_0-1669944445184.png

Best Regards

Community Support Team _ Rena
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-yiruan-msft
Community Support
Community Support

Hi @murphm6 ,

As checked your screenshot, it seems that there are 3 levels under the Rows fields, you can create the measures as below to get the desired result. Then out these new measures onto the matrix visual to replace the original fields... Please find the details in the attachment.

ASP = 
IF (
    (ISINSCOPE ( 'Table'[Item] ) || ISINSCOPE ( 'Table'[Sub Item] )),
    SUM ( 'Table'[ASP Value] ),
    BLANK ()
)
Multi-Year Month Avg = 
IF (
    ISINSCOPE ( 'Table'[Item] ) || ISINSCOPE ( 'Table'[Sub Item] ),
    AVERAGE ( 'Table'[Mult-Year Month Value] ),
    BLANK ()
)

yingyinr_0-1669864386847.png

Best Regards

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

Hi @v-yiruan-msft

 

Thank you for the response. It appears to almost be correct. I only want the values for ASP and multi-year avg to appear for the second value (item as you have it) and not the sub-item. Is this possible?

 

Desired results look like this: 

murphm6_0-1669910903463.png

 

Hi @murphm6 ,

Please update the formula of measure [] and [] as below,  you can find the details in the attachment.

ASP =
IF (
    ISINSCOPE ( 'Table'[Item] ) && NOT ( ISINSCOPE ( 'Table'[Sub Item] ) ),
    SUM ( 'Table'[ASP Value] ),
    BLANK ()
)
Multi-Year Month Avg =
IF (
    ISINSCOPE ( 'Table'[Item] ) && NOT ( ISINSCOPE ( 'Table'[Sub Item] ) ),
    AVERAGE ( 'Table'[Mult-Year Month Value] ),
    BLANK ()
)

yingyinr_0-1669944445184.png

Best Regards

Community Support Team _ Rena
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 Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors