Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Remove duplicates in ranking of 10

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.

 

 

image.png

How can I do it. Kindly help me.

Thx so much

5 REPLIES 5
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

I build a table like yours to have a test.

1.png

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:

2.png

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. 

Anonymous
Not applicable

@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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.