- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Intersection of 2 Category
I have a transaction table and product category table.
Client buys multiple category product and I need to calculate the count of customer who purchased only type1 and type2 together minus the result of when these category are bought together along with third category
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Anonymous
You can refer to the following measure, the sample data is the same as yours
Measure =
VAR a =
CALCULATETABLE (
DISTINCT ( 'Table'[Customer_id] ),
'Table'[Product_category] IN { 1, 2 }
)
VAR b =
CALCULATETABLE (
DISTINCT ( 'Table'[Customer_id] ),
'Table'[Product_category] = 3
)
RETURN
COUNTROWS ( EXCEPT ( a, b ) )
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

are you able to share some sample data in text format?
If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Transaction_id | Customer_id | Product_category |
55640237 | 7263991 | 1 |
55640237 | 7263991 | 3 |
55640237 | 7263991 | 3 |
55640237 | 7263991 | 1 |
47810976 | 538974 | 2 |
46096606 | 765478 | 1 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Anonymous
You can refer to the following measure, the sample data is the same as yours
Measure =
VAR a =
CALCULATETABLE (
DISTINCT ( 'Table'[Customer_id] ),
'Table'[Product_category] IN { 1, 2 }
)
VAR b =
CALCULATETABLE (
DISTINCT ( 'Table'[Customer_id] ),
'Table'[Product_category] = 3
)
RETURN
COUNTROWS ( EXCEPT ( a, b ) )
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
04-29-2024 02:19 PM | |||
08-12-2024 04:33 PM | |||
09-05-2024 02:41 AM | |||
10-30-2024 09:17 PM | |||
Anonymous
| 08-13-2024 04:13 AM |
User | Count |
---|---|
87 | |
81 | |
53 | |
38 | |
35 |