Forum Discussion
distinct count and group by
- Anonymous6 years ago
Anonymous
The measure should something like the follow:Count OF Cust Ordered = CALCULATE(DISTINCTCOUNT('Table'[Cust]),ALLEXCEPT('Table','Table'[Tier],'Table'[Region]),FILTER('Table','Table'[Order]<>BLANK())) % = [Count OF Cust Ordered]/COUNT('Table'[Cust])Matrix:
Community Support Team _ Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Anonymous
There are multiple ways of achieving this. One below is without using any measures
Here is the sample dataset I have created for this purpose:
Then I have used the matrix visual, and dragged Order Quantity thrice under Values:
- I selected Count from the field properties
- I selected Sum from field properties
- I selected Sum from field properties > Show Value as > Percent of column total
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
Connect on LinkedIn
vivran22 thank your very much for your help. but NO. thats not what i am looking for.
I am looking for % of #Cust place an order. (Yes - ordered; NO - didnt ordered) . Like 10 out of 20 ordered. 50% placed order.
In your example. every cust had ordered. thats 100% placed order...
but not every Cust is in the fact or transcation table; so thats why i cut out 4 cust in my example. total 20 cust only 16 had ordered.
- vivran226 years ago
Community Champion
Anonymous
You requirement was not as detailed in your orignal post. Basis your recent input, may I suggest you to have a separate table for maintaing list of customers:
Customer table:
and separate table for sales order:
Create the relationship between these two tables:
and then use following measures to get the desired results:
Total Customers = COUNTROWS(dtCust) Customer Ordered = DISTINCTCOUNT(dtSales[Customer]) % Ordered = DIVIDE([Customer Ordered],[Total Customers])Result:
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
Connect on LinkedIn