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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
TomBINGL
New Member

Limiting Top N to only the top 5 records where a count is being filtered

Hi all,

 

I have a large dataset which is primarily focusedon service provision data (support ticket logging). I've seen a fair few different posts around ranking based on a rankx funcitonetc. but I can't quite get what I need out of the information available. I tihnk this is down to the fact I'm using a measure rather than a column to achieve what I need here.

 

I'm fairly new to any in-depth DAX functions so apologies for if this is a fairly obvious one.

 

I have tried a couple of recommended solutions from previous posts but I can't quite get it to work, I'm looking to get a dynamic function in place rather than manually filter out duplicate counts (by contact).

 
I'm attempting to distinctly count a ticket ID (using a measure) to see number of tickets logged per user (contact) and visualise those by the corresponding user in descending order in a bar chart (effectivley creating a rank). The ticket ID count measure is being used to filter on Top N (top 5 results) but where duplicates of the ticket ID count exist I'm seeing more than the top 5.
 
So in relation to the below image (Resulting table), where we see duplicate counts (Andy has logged 2 support tickets and so have Chloe, Emily, Kyle Lauren and Stephen) we only want to see the top 5 displayed, with any duplicates limited to equate to the top 5 only.
 
The data being pulled into the visual is set up in two tables, one with ticket records and the other with contacts using an ID as the key.
 
Contacts table:
TomBINGL_0-1694520110892.png

 

Tickets table:

TomBINGL_1-1694520150781.png

 

Resulting table example (Rank added for example purposes only):

TomBINGL_2-1694520184918.png

 

Filters on visual in PBI desktop:

TomBINGL_3-1694521034081.png

 

 Bar chart in PBI desktop:

TomBINGL_4-1694521227816.png

 

 

Any help would be greatly appreciated.

 

Many thanks,

Tom

 

 

 

0 REPLIES 0

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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