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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to use ISINSCOPE in matrix?

I have an AD group table:

 

AD groupNameEmp
XyzMary1
XyzPaul2
ServicePaul2
IT3Paul2
IT3Tim3
IT3Juana4
IT3Karla5
IT3Tatiana

6

 

 

and a Employee table:

EmpNameDepartment
1MaryR
2PaulR
3TimE
4JuanaE
5KarlaE
6TatianaT

 

 

I am trying to display for each AD group, people from how many deparments they have, as:

AD groupNumberOf Dept
Xyz1
Service1
IT33

 

It works fine, I am using 

SUMX (   DISTINCT(Employee[Department]),1  )
 
But when I use a matrix, and I try to pull the Department as well, I use:
 
NumberofBU =
IF (
    ISINSCOPE(AllADGroupMembers[GroupName]),
    SUMX(DISTINCT(Employee[Business]),1),
    BLANK()
)

But it doesnt work, I want to see BLANK in the departments, but I still see a value:
 
How can I force a blank here, instead of seeing "1"?
ovonel_0-1664270947239.png

 

 

 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, you want to  see BLANK in the departments. Right?

Here are the steps you can refer to :
(1)This is my test data which is the same as yours:

vyueyunzhmsft_0-1664329563942.png

We need to create a relationship between two tables:

vyueyunzhmsft_1-1664329647738.png

 

(2)We can create a calculated column in Multi-terminal tables:

de_name = RELATED('Sheet1'[Department])

vyueyunzhmsft_2-1664329669520.png

(3)We can create a measure :

Count = IF(ISINSCOPE('Sheet1'[Department]),BLANK(), SUMX( DISTINCT('Sheet2'[de_name]),1))

(4)Then we put the measure in the visual and the field we need like this  and we will meet your need:

vyueyunzhmsft_3-1664329822860.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

6 REPLIES 6
Anonymous
Not applicable

ISINSCOPE doesnt seem to work for me...

 

It works at first here:

NumberofBU =
IF (
    ISINSCOPE(AllADGroupMembers[GroupName]),
    SUMX(DISTINCT(Employee[Business]),1),
    BLANK()
)


ovonel_0-1664267076667.png

 

 

But, when I drag GroupName, it stops working!

ovonel_1-1664267301932.png

 

 

Why is it displaying a 1 for Business? It should be blank!

That looks to be working as expected. If you have the Group Name in the rows then the only time ISINSCOPE would return false would be in the total row.

v-yueyunzh-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, you want to  see BLANK in the departments. Right?

Here are the steps you can refer to :
(1)This is my test data which is the same as yours:

vyueyunzhmsft_0-1664329563942.png

We need to create a relationship between two tables:

vyueyunzhmsft_1-1664329647738.png

 

(2)We can create a calculated column in Multi-terminal tables:

de_name = RELATED('Sheet1'[Department])

vyueyunzhmsft_2-1664329669520.png

(3)We can create a measure :

Count = IF(ISINSCOPE('Sheet1'[Department]),BLANK(), SUMX( DISTINCT('Sheet2'[de_name]),1))

(4)Then we put the measure in the visual and the field we need like this  and we will meet your need:

vyueyunzhmsft_3-1664329822860.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

lukiz84
Memorable Member
Memorable Member

Hi,

 

use:

IF(NOT(ISINSCOPE(Employee[Department]), ...)

 

because in a matrix, everything thats visible ABOVE your desired blank is also "in scope".

 

BR

Anonymous
Not applicable

doesnt seem to work either

did you put Employee[Department] on the Matrix or another field of Employee?

 

I just tried it and it works on my side...

 

NumberofBU =
IF (
    NOT(ISINSCOPE(Employee[Depeartment])),
    SUMX(DISTINCT(Employee[Business]),1),
    BLANK()
)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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