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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ablalm
Regular Visitor

Visualization of overlap between users belongings

Hi there,

 

I have a list of stockholders, their unique id, name, stockname and how much do they have. In one row only information about one user and one stock type. I need to find out  with whom have the most overlap stocks one exact user. 

 

In the screenshots the example of the sheet i have. And the result that I want to get for one user (George).

ablalm_0-1676882793440.png

ablalm_1-1676882811406.png

 

Thank you. 

1 ACCEPTED SOLUTION

hi @ablalm 

try to 

1) add a calculated table like:

SlicerTable = ALL(TableName[user_name])

2) add a slicer with SlicerTable[user_name]

3) plot a table visual with TableName[user_name], TableName[user_id] and a measure like:

OVERLAP = 
VAR _name1 =MAX(TableName[user_name])
VAR _name2 =SELECTEDVALUE(SlicerTable[user_name])
VAR _list1 =
CALCULATETABLE(
    VALUES(TableName[stocks]),
    ALL(TableName[user_id]),
    TableName[user_name] = _name1
)
VAR _list2 =
CALCULATETABLE(
    VALUES(TableName[stocks]),
    ALL(TableName[user_id]),
    TableName[user_name] = _name2
)
VAR _count =
COUNTROWS(INTERSECT(_list1, _list2))
RETURN
IF(
    _name1=_name2,
    BLANK(),
    _count
)

 

it worked like:

FreemanZ_0-1676894853037.png

 

FreemanZ_1-1676894877524.png

View solution in original post

6 REPLIES 6
tamerj1
Super User
Super User

Hi @ablalm 
Please refer to attached sample file with the proposed solution.

1.png

Thank you!

FreemanZ
Super User
Super User

hi @ablalm 

your data seems inconsistent, like 3 is Tom or Ivan?

 

hi @FreemanZ 

 

sorry for that, here is the correct output

ablalm_0-1676889629315.png

 

hi @ablalm 

try to 

1) add a calculated table like:

SlicerTable = ALL(TableName[user_name])

2) add a slicer with SlicerTable[user_name]

3) plot a table visual with TableName[user_name], TableName[user_id] and a measure like:

OVERLAP = 
VAR _name1 =MAX(TableName[user_name])
VAR _name2 =SELECTEDVALUE(SlicerTable[user_name])
VAR _list1 =
CALCULATETABLE(
    VALUES(TableName[stocks]),
    ALL(TableName[user_id]),
    TableName[user_name] = _name1
)
VAR _list2 =
CALCULATETABLE(
    VALUES(TableName[stocks]),
    ALL(TableName[user_id]),
    TableName[user_name] = _name2
)
VAR _count =
COUNTROWS(INTERSECT(_list1, _list2))
RETURN
IF(
    _name1=_name2,
    BLANK(),
    _count
)

 

it worked like:

FreemanZ_0-1676894853037.png

 

FreemanZ_1-1676894877524.png

Thanks a lot!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.