Forum Discussion
sofias
4 years agoFrequent Visitor
Help with distinct calculate on 2 columns
I have a table with 2 columns. "Sales Rep" and "Battle Name" as following sample:
| Sales Rep | Battle Name |
| [email protected] | LESS_L2W_3_ORDERS |
| [email protected] | NOT_ACTIVE_L13W |
| [email protected] | NOT_ACTIVE_L13W |
| [email protected] | LESS_L2W_3_ORDERS |
| [email protected] | LESS_L2W_3_ORDERS |
| [email protected] | NOT_ACTIVE_L13W |
| [email protected] | NOT_ACTIVE_L13W |
| [email protected] | LESS_L2W_3_ORDERS |
| [email protected] | NOT_ACTIVE_L13W |
| [email protected] | LESS_L2W_3_ORDERS |
| [email protected] | NOT_ACTIVE_L13W |
| [email protected] | LESS_L2W_3_ORDERS |
| [email protected] | LESS_L2W_3_ORDERS |
| [email protected] | NOT_ACTIVE_L13W |
| [email protected] | LOWER_L4W_GMV |
| [email protected] | LESS_L2W_3_ORDERS |
| [email protected] | NOT_ACTIVE_L13W |
| [email protected] | LESS_L2W_3_ORDERS |
| [email protected] | LESS_L2W_3_ORDERS |
I want to calculate how many sales rep has 1 battle, how many have 2 and so on. I tryied a lot of things such as distinctcount, filter, group by but none of them made me able to achieve the result below:
| Number of Battles | Total of Sales Reps |
| 1 | 2 |
| 2 | 8 |
| 3 | 1 |
| 4 | 0 |
| 5 | 0 |
| 6 | 0 |
Can anyone help me, explaining, how can I get the result I need?
1 Reply
- lbendlinSuper User
1. create a disconnected table
Battles = GENERATESERIES(1,6)2. for each value of this table, compute the number of reps that fall into that bucket. That can be done as a measure or a calculated column - the example here is for a calculated column.
#SR = 0+countrows(filter(summarize('Table','Table'[Sales Rep],"Battles",count('Table'[Battle Name])),[Battles]=[Value]))Lastly, display the result in a table. Do not summarize [Value], but show items with no data.