Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Good afternoon.
I have read a lot regarding the topic, but no matter how much I apply the examples it just doesn't work for me.
I have a table of products, where there are many products with their price, user. I need in a matrix to show the name of the product and the ranking considering the one that has been bought the most times.
But if there is a product that has been purchased 4 times and another that has been purchased the same 4 times, it does not make me duplicate, then when doing my ranking instead of taking 10 more purchased products it gives me 11 or 12.
How can I do it. Kindly help me.
Thx so much
Hi @Anonymous
I build a table like yours to have a test.
I use measures to achieve your goal.
CountBuyer = CALCULATE(COUNTROWS(Sales),FILTER(ALL(Sales),Sales[Product Name]=MAX(Sales[Product Name])))
Rank = RANKX(ALL(Sales), [countBuyer],,desc,Dense)
Result:
You can download the pbix file from this link: Remove duplicates in ranking of 10
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-rzhou-msft Thanks for your time and solution, Download the exercise you did, and load the data I had, but I still get duplicate results, although in the Filter on this visual part, enter top 10, it does not respect me and shows me more than 10 products.
https://drive.google.com/file/d/10rMaUUKArLkwV2JdTFUc5EnPE60Y_1Lc/view?usp=sharing
I attach the example with my data. 🙂
Hi @Anonymous
Could you tell me if your problem has been solved? If it is, please share your solution, and Accept it as a solution. More people will benefit from it. If you are still confused about it, please share me with your pbix file from your Onedrive for Business. I don't have access to your pbix file shared in your link.
Best Regards,
Rico Zhou
Hi @Anonymous
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table or share me with your pbix file from your onedrive for business.
Best Regards,
Rico Zhou
@Anonymous , refer how to break ties in rank
https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/
https://www.youtube.com/watch?v=kRtmb8ftyQc
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |