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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
EWBWEBB
Helper III
Helper III

TOPN where Count is greater than X

I'm trying to produce a visual that shows the most effective method of candidate attraction by % using TOPN filter on a visual.

 

I'm not interested in sources which have less than 25 applicants.

 

The problem I am running into is that those with less than 25 applicants are consistently in the top 5 by %. 

The TOPN doesn't account for the greater than 25 applicants and I end up with a table that only shows 1 result.

 

Example of the result with/without the Greater than 25 filter. 

 

I'm sure I could do this and create an additional table but I'd really rather not - any one have any ideas on a way around this. Happy to re-write a dax measure if I need to.

 

WIthout greater than 25 filter

EWBWEBB_0-1695818926981.png

 

With the less than 25 filter

EWBWEBB_1-1695819096459.png

 

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

While the TOPN filter in the filter panel is fantastic, and should always be your first choice, it does have some limitiation mainly in that is entirely dependent on the current filter context.  This may not always be what you want. In such cases it's ok to implement your own logic via the DAX TOPN() or even via completely custom code.

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file.  Explain the question and show the result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

While the TOPN filter in the filter panel is fantastic, and should always be your first choice, it does have some limitiation mainly in that is entirely dependent on the current filter context.  This may not always be what you want. In such cases it's ok to implement your own logic via the DAX TOPN() or even via completely custom code.

Hi @lbendlin 

I took this approach in the end, but a little differently. 

 

I just used a variable to retain the total number of applications then on the return statement used and IF logic to set any with under 25 applicant to -1 so they would never be in the top 5.

 

Problem solved 😄

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.