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

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.

Reply
EWBWEBB
Helper II
Helper II

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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