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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rginny_
Helper I
Helper I

Count all shared values with condition

Hi everyone,

 

I cannot seem to figure out how to do the below.

I have a table like this:

UserEntity
A1
A2
A3
B2
C1
C2
C4
D2
D4

 

Essentially what I'd like to do is count how many times one entity appears with another entity based on users.

So I'd like to get all possible unique combination of entities (in two separate columns) and the count of times they appear with the same user (as a third column)- see the below table:

 

Entity 1Entity 2User Count
122
131
141
231
242
340

 

So for example the combination '1-2' has a user count of 2 because both A and C appear with entity 1 and 2.

On the other hand, the combination of '1-3' has a user count of 1 because A is the only person who appears with both entity 1 and entity 3.

I hope that makes sense and if someone could help me figure out how to get that second table I would be super grateful!

 

Many thanks,

Ginny

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User
4 REPLIES 4
amitchandak
Super User
Super User

Thank you so much @amitchandak , this is exactly what I was looking for!

Ashish_Mathur
Super User
Super User

Hi,

You may download my solution file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Tad17
Solution Sage
Solution Sage

Hey @rginny_ 

 

Check out this thread: https://community.powerbi.com/t5/Desktop/distinct-count-of-multiple-columns/td-p/433060

 

It is similar to what you are looking for though the result was measures which can be listed in a table or cards. Did you need it in a calculated table?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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