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.
Hello I have the following data set and need your help to get a measure that calculates the count of products that were bought by 'n' customers
Column A: Product ID
Column B: Customer ID
Column C: Qty bought by customer
Column D : distinct count of customers who bought each product
Column E: Require DAX measure to calculate the distinct count of products that were bought by less than 'n' customers.
Solved! Go to Solution.
Hi, @hassanh2
You can refer to @lucadelicio reply. If it does not work, you can try this.
Measure:
Counts =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Product ID] ),
'Table'[Qty] <> 0
)
)
Product ID if less counts =
VAR _getNumber =
SELECTEDVALUE ( Number[Value] )
VAR _productId =
SELECTEDVALUE ( 'Table'[Product ID] )
VAR _result =
IF ( [Counts] < _getNumber, 1, 0 )
RETURN
_result
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Thank you so much .. this was very helpful and it gave me the required outcome.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.