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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi
I have following table
Product | Customer number |
A | 1 |
B | 1 |
C | 1 |
F | 2 |
A | 2 |
Definition of customer: If the customer has purchased product A or B, only then we consider the customer.
I want to create a count of customers based on these criteria. Also, it needs to add slicer products. However, whenever I select product F, technically it should show 1 customer. But it is showing blank.
Solved! Go to Solution.
Hi, @Anonymous
Thank you very much for your reply. Using the following DAX expression will get a count of different IDs:
Count Customer =
VAR _seleted_product =
SELECTCOLUMNS ( 'Table', 'Table'[Product] )
VAR _table =
FILTER ( 'Table', 'Table'[Product] IN _seleted_product )
VAR _ID_AB =
SUMMARIZE (
FILTER ( ALL ( 'Table' ), 'Table'[Product] IN { "A", "B" } ),
'Table'[Customer number]
)
RETURN
IF (
ISFILTERED ( 'Table'[Product] ),
COUNTAX (
SUMMARIZE (
FILTER ( _table, 'Table'[Customer number] IN _ID_AB ),
'Table'[Customer number]
),
'Table'[Customer number]
)
)
Here are the results:
I've uploaded the PBIX file below for your reference.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you @ryan_mayu
Hi, @Anonymous
Based on the data you provided and the expected results described, I created a measure using the following DAX expression:
Count Customer =
VAR _seleted_product =
SELECTCOLUMNS ( 'Table', 'Table'[Product] )
VAR _table =
FILTER ( 'Table', 'Table'[Product] IN _seleted_product )
VAR _ID_AB =
SUMMARIZE (
FILTER ( ALL ( 'Table' ), 'Table'[Product] IN { "A", "B" } ),
'Table'[Customer number]
)
RETURN
IF (
ISFILTERED ( 'Table'[Product] ),
COUNTROWS ( FILTER ( _table, 'Table'[Customer number] IN _ID_AB ) )
)
Here are the results:
I've provided the PBIX file used this time below.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is good. However, if I select A, B and F, it should return 2 as there are only two unique customer
Hi, @Anonymous
Thank you very much for your reply. Using the following DAX expression will get a count of different IDs:
Count Customer =
VAR _seleted_product =
SELECTCOLUMNS ( 'Table', 'Table'[Product] )
VAR _table =
FILTER ( 'Table', 'Table'[Product] IN _seleted_product )
VAR _ID_AB =
SUMMARIZE (
FILTER ( ALL ( 'Table' ), 'Table'[Product] IN { "A", "B" } ),
'Table'[Customer number]
)
RETURN
IF (
ISFILTERED ( 'Table'[Product] ),
COUNTAX (
SUMMARIZE (
FILTER ( _table, 'Table'[Customer number] IN _ID_AB ),
'Table'[Customer number]
),
'Table'[Customer number]
)
)
Here are the results:
I've uploaded the PBIX file below for your reference.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
maybe you can try to create a new column
Proud to be a Super User!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
6 | |
3 | |
3 | |
3 |
User | Count |
---|---|
13 | |
11 | |
9 | |
8 | |
8 |