- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
TopN filter returning more than N requested
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-07-2016 08:48 AM
I am using the TopN filter and when I do I do it returns more than the N i requested. I used top 10 agents by conversion but it returned almost 30 agents. Does conversioni= infinity or NaN have anything to with it? If I take those out I still get more than ten agetns listed. All help is apprecitated.
Re: TopN filter returning more than N requested
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-10-2016 03:25 AM
In DAX, when using TOPN() function, it returns top N rows based on the order_by_expression. However if the order_by_expression has same values, those rows will be retrieved. That's the reason why you get more than 10 agents.
Regards,
Re: TopN filter returning more than N requested
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-10-2016 06:36 AM
It's giving you everyone that's tied for the same spot. I think that's what @v-sihou-msft is saying too but I'm not sure. Anyway topn returns the matches for the top n scores, not the first n matches it finds. So imagine you want the top 10 people, but 3 people are tied for number 1, 7 are tied for number 2, and there's only 1 each for 3rd place through 10th place. TOPN will give you 18 people, not 10. If you only want 10, you need to come up with a way to calculate a tie-breaker that will force each person to have a unique score.