Forum Discussion
Rankx or Topn
Dear All ,
i would need you support to retrive my top customers
I have the following table
| Year month | product details | Client | Tons |
| 18-Jan | aa | 11 | 5 |
| 18-Jan | v | 2 | 4 |
| 18-Jan | ds | 11 | 3 |
| 18-Jan | dsg | 1 | 34 |
| 18-Jan | sdfs | 2 | 5 |
| 17-Dec | df | 11 | 4 |
| 17-Dec | zf | 11 | 3 |
| 17-Dec | dz | 11 | 34 |
| 17-Dec | z | 2 | 5 |
| 17-Dec | df | 2 | 6 |
| 17-Dec | zf | 2 | 7 |
| 17-Dec | dfz | 1 | 3 |
| 17-Nov | zf | 11 | 4 |
| 17-Nov | zdf | 11 | 3 |
| 17-Nov | zdd | 2 | 4 |
| 17-Nov | fz | 2 | 5 |
| 17-Nov | zf | 2 | 3 |
| 17-Nov | fzd | 11 | 4 |
| 17-Nov | zf | 1 | 4 |
I have different month - clients products tons ect... a lot of info
I want to retrive my top 2 customers from the above for each month or accumultate month if i do the selection.
COuld you please help me with this can t get the foruma right ..
so let s say i select a business unit and a month to give me in a list top 2 customers with amount next to it and maybe total under ?
Many Thanks,
Alex
Hi alexbalazsalex,
Was my above suggestion helpful to you? If yes, would you please kindly mark it as an answer so that it can benefit more users?
Thanks,
Yuliana Gu
4 Replies
- alexbalazsalexHelper IV
ex
Maybe to look something like this :
- v-yulgu-msftMicrosoft Employee
Hi alexbalazsalex,
Please try below measures:
Total tons = CALCULATE ( SUM ( Client_Tons[Tons] ), ALLEXCEPT ( Client_Tons, Client_Tons[Year month], Client_Tons[Client] ) ) Rankx = RANKX ( ALLEXCEPT ( Client_Tons, Client_Tons[Year month] ), Client_Tons[Total tons], , DESC, DENSE )Insert a table visual and drag corresponding fields to it. If you want to show TopN records, please add [RANKX] into "visual level filters" and set its value to be equal to or less than N.
Best regards,
Yuliana Gu
- alexbalazsalexHelper IV
Thanks v-yulgu-msft
I will give ti a try and let you know..
meanwhile fi you get a chance could you please have a look at my other thread ? mabe you have an i deea what i could do to make it work ..
https://community.powerbi.com/t5/Desktop/Urgent-Support-for-matrix-table/m-p/369162#M167237
Many many thanks
Alex
- v-yulgu-msftMicrosoft Employee
Hi alexbalazsalex,
Was my above suggestion helpful to you? If yes, would you please kindly mark it as an answer so that it can benefit more users?
Thanks,
Yuliana Gu