Forum Discussion
Index in a Top n Table Visual
Hello everybody,
So I want to create a simple 'Top n Customers by Sales Value' visual. There is no index to show whose customers is in which place though. This is what I'm going for...
| N-th Place | Customer Name | Sales Value (LCY) |
| 1 | Customer A | 125,000 |
| 2 | Customer B | 110,000 |
| 3 | Customer C | 87,000 |
| 4 | Customer D | 63,000 |
| 5 | Customer E | 29,000 |
What I want is that very first column, but there is also slicers to select the period (month and year) and sales team. So a precalcuated column is not applicable to this, because as soon as you change those parameters, the values wouldn't be correct anymore. I try finding a solution to this for a while now and can't find any. Is there a way to just plonk that column on there?
Thanks in advance!
Hi taiboontam ,
Has your problem been solved? If it is solved, please mark a reply which is helpful to you.
If the problem is still not resolved, please try the following measure:
Rank = RANKX ( ALLSELECTED ( 'Table'[Customer Name] ), CALCULATE ( SUM ( 'Table'[Sales Value (LCY)] ) ), , DESC, SKIP )Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- amitchandak
Super User
taiboontam , You can use rank , assume Sales Value (LCY) is a measure
rankx(Allselected(Table[Customer name]), [Sales Value (LCY)],,desc,dense)
you can use visual level filter for 5
- taiboontamNew Member
Ah yeah, the Sales Value is not a measure..... It's just a normal data in a table
- v-kkf-msft
Community Support
Hi taiboontam ,
Has your problem been solved? If it is solved, please mark a reply which is helpful to you.
If the problem is still not resolved, please try the following measure:
Rank = RANKX ( ALLSELECTED ( 'Table'[Customer Name] ), CALCULATE ( SUM ( 'Table'[Sales Value (LCY)] ) ), , DESC, SKIP )Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Jihwan_Kim
Super User
Hi,
I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope the below DAX measure helps to create a new measure and apply it to your data model.
Rank Nth Place: = IF ( HASONEVALUE ( Customers[Customer] ), RANKX ( SUMMARIZE ( ALLSELECTED ( Data ), Customers[Customer] ), [Sales total:], , DESC ) )