Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi everyone,
I cannot seem to figure out how to do the below.
I have a table like this:
| User | Entity |
| A | 1 |
| A | 2 |
| A | 3 |
| B | 2 |
| C | 1 |
| C | 2 |
| C | 4 |
| D | 2 |
| D | 4 |
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 1 | Entity 2 | User Count |
| 1 | 2 | 2 |
| 1 | 3 | 1 |
| 1 | 4 | 1 |
| 2 | 3 | 1 |
| 2 | 4 | 2 |
| 3 | 4 | 0 |
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
Solved! Go to Solution.
Please find the solution at :https://www.dropbox.com/s/m28qblkceaskoto/Entity_problem.pbix?dl=0
Please find the solution at :https://www.dropbox.com/s/m28qblkceaskoto/Entity_problem.pbix?dl=0
Hi,
You may download my solution file from here.
Hope this helps.
Hey @Anonymous
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?
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 49 | |
| 35 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 92 | |
| 75 | |
| 41 | |
| 26 | |
| 25 |