Forum Discussion
Top N per group
| Case_Category__c | Department | # Cases |
| Ad hoc invoice/ credit note requests | Billing | 51 |
| Contract queries | Billing | 4 |
| Development invoice/ credit note requests | Billing | 2 |
| Invoice/ credit note release requests | Billing | 5 |
| Invoice/Credit note Queries | Billing | 46 |
| Other | Billing | 19 |
| Refund requests | Billing | 3 |
| Allocation queries | Cash - General | 14 |
| Bank detail info request | Cash - General | 1 |
| Other | Cash - General | 22 |
| Remittances | Cash - General | 5 |
| Specific transaction enquiry | Cash - General | 5 |
| Ad hoc requests | Cash - Notifications | 33 |
| Change of bank details | Cash - Notifications | 10 |
| Expenses forms | Cash - Notifications | 64 |
| Expenses queries | Cash - Notifications | 10 |
| Other | Cash - Notifications | 4 |
| Remittances | Cash - Notifications | 5 |
| Soldo top up requests | Cash - Notifications | 8 |
I want to show the top 3 case category's, by department. I've tried all sorts of ranking measures but none seem to work. The # cases column is a measure, counting the case ID in my case table
Any help would be appreciated
- Anonymous6 years ago
Now It's working as per your expectation.
Rank2 = var a = RANKX(ALLSELECTED('Case'[Case_Category__c]),[# Cases],[# Cases],DESC,Dense) var b = SWITCH(SELECTEDVALUE(Dummy[Input]),"1",1,"2",2,"3",3,"4",4,"All",99) return if(a<=b,1,0)
Make sure here we are checking for first 4 and 'all' as 5th input. Just modify var b as per your requirement
Thanks & Regards,
Pravin
17 Replies
- AnonymousNot applicable
So for example, for 'Billing' department, I want a measure (or visual filter) that can be used on a bar chart so I only see 'Ad hoc invoice/ credit note requests', 'Invoice/Credit note Queries' and 'Other' - the top 3 (by # cases)
- AnonymousNot applicable
Anonymous
1. I ranked the measure #Case by department using the following DAX:Rank Measure = RANKX( ALLEXCEPT('Table', 'Table'[Department]), [#Case measure],, DESC)2. The next step is to set a visual level filter to the Rank measure:
Paul,
Best- AnonymousNot applicable
Ceate one dummy table with input column.
Input
1
2
.
..
..
20
Use this column for accepting N input.
Then create below measure.
Rank =var a =RANKX(ALLSELECTED('table'Department),[#cases],,DESC,Dense)var b =SWITCH(SELECTEDVALUE('Dummy'[Input]),"1",1,"2",2,"3",3,"4",4,"5",5,"All",99)returnif(a<=b,1,0)- AnonymousNot applicable
Then add measure in visual level filter and set rank is not 0.
If i solve your problem, Mark it as solution.
Thanks,
Pravin
- AnonymousNot applicable
Anonymous thanks for your response,
This is what I have tried - but strangely it doesn't rank as expected, see below.