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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello Everyone,
I'm trying to figure out how to get the count of unique computer_ids that have 2 different strings in different rows. For example, if computer_id = color[red] AND color[green] THEN count 1. The example below should equate to a count of 2.
| id | color | computer_id |
| 1 | red | 101 |
| 2 | red | 102 |
| 3 | red | 103 |
| 4 | green | 101 |
| 5 | green | 102 |
| 6 | yellow | 103 |
Thanks in advance for any help!
Solved! Go to Solution.
Hi, @daxn00b
Please try the below measure.
Red and Green =
VAR redcom =
SUMMARIZE ( FILTER ( ALL ( Data ), Data[color] = "red" ), Data[computer_id] )
VAR greencom =
SUMMARIZE ( FILTER ( ALL ( Data ), Data[color] = "green" ), Data[computer_id] )
RETURN
COUNTROWS ( INTERSECT ( redcom, greencom ) )
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster.
Hi,
You can also try the following measure to get the same result.
ResultCount =
COUNTROWS(
INTERSECT(
CALCULATETABLE(VALUES(Data[computer_id]),Data[Color] = "green"),
CALCULATETABLE(VALUES(Data[computer_id]),Data[Color] = "red")
))
Same method, I have implemented in the following video.
Hi, @daxn00b
Please try the below measure.
Red and Green =
VAR redcom =
SUMMARIZE ( FILTER ( ALL ( Data ), Data[color] = "red" ), Data[computer_id] )
VAR greencom =
SUMMARIZE ( FILTER ( ALL ( Data ), Data[color] = "green" ), Data[computer_id] )
RETURN
COUNTROWS ( INTERSECT ( redcom, greencom ) )
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 19 | |
| 11 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 20 | |
| 12 | |
| 10 |