Forum Discussion
IvanMislav
5 years agoHelper I
Custom calculation based on product categories
Hi, I'm trying to find a way to calculate pecentage of customers that purchased something from a certain group of products. Table example blow: Customer Category Product Purchased? ...
- 5 years ago
Hi IvanMislav
Try this measure. According to your sample data, 100% of the customers purchased DRINKS rather than 50%.
Measure = VAR __allCustomers = CALCULATE(DISTINCTCOUNT('Table'[Customer]),ALL('Table')) VAR __buyingCustomers = CALCULATE(DISTINCTCOUNT('Table'[Customer]),ALLEXCEPT('Table','Table'[Category]),'Table'[Purchased?]=TRUE()) RETURN DIVIDE(__buyingCustomers,__allCustomers)+0Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
v-jingzhang
5 years agoCommunity Support
Hi IvanMislav
Try this measure. According to your sample data, 100% of the customers purchased DRINKS rather than 50%.
Measure =
VAR __allCustomers = CALCULATE(DISTINCTCOUNT('Table'[Customer]),ALL('Table'))
VAR __buyingCustomers = CALCULATE(DISTINCTCOUNT('Table'[Customer]),ALLEXCEPT('Table','Table'[Category]),'Table'[Purchased?]=TRUE())
RETURN
DIVIDE(__buyingCustomers,__allCustomers)+0
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.