Forum Discussion
Top 10 and filter
Hi Everybody,
I have a problem with the top 10 and the filter.
I created a top 10 of EAN's tyre by the quantity. It's correct.
But when i add a filter in the visual to filter by agency, the top 10 became 11 or more.
Can you help me please ?
Thanks in advance.
Have a nice day
Hi Sylvine_Wyz ,
You get more than 10 values with Top 10 filter because of common values and hence power bi by default dense ranks it.
You will need to create a rank column and pull this rank column in top 10 filter.
1. Create a new column with below dax; This column will set bifercation between same values :
Number+Random = 'Table'[number]+RAND()2. Create another column for ranking and this will be pulled in top 10 filter:RANX =RANKX('Table','Table'[Number+Random],,1)Note:Names in my above example,> Table Name = Table> Field to filter top 10 = Number> Column 1 created = Number+Random> Column 2 created = RANXReference Image:Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!
5 Replies
- amitchandakSuper User
Sylvine_Wyz , if these is same value, Try to create a rank with tie breaker and filter that
https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415 - Anand24Super User
Hi Sylvine_Wyz ,
You get more than 10 values with Top 10 filter because of common values and hence power bi by default dense ranks it.
You will need to create a rank column and pull this rank column in top 10 filter.
1. Create a new column with below dax; This column will set bifercation between same values :
Number+Random = 'Table'[number]+RAND()2. Create another column for ranking and this will be pulled in top 10 filter:RANX =RANKX('Table','Table'[Number+Random],,1)Note:Names in my above example,> Table Name = Table> Field to filter top 10 = Number> Column 1 created = Number+Random> Column 2 created = RANXReference Image:Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!- Sylvine_WyzHelper IV
Hello,
Thanks everybody for your help.
I found a solution in your post and with youtube's help.
Have a nice day !
- AnonymousNot applicable
I am still very confused on this DAX for Top N. I simply could not achieve it to display Top 10 rows. See printscreen.
It always give more than 10 rows here, why is this so?