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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculate the top records in a table so a slicer can be used

Hi, I want to be able to create a  slicer in which it only shows the top 5 of a table whose values are summed, like the table on the right, which calculates the sum of the values on the left
Can someone suggest a way to do this?

So when I hook a slicer to the table on the right, i only want the slicer to show the top 5 records and ignore the rest.

MRUry7_3-1702664295564.png

 

 

 



2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @Anonymous 

You can use the top n dax function.
Please refer to the linked tutorial :

https://www.youtube.com/watch?v=vpGAf6Nkt1Q

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Write these measures

C = sum(Data[Clicks])

Top 5 Query by clicks = calculate([c],topn(5,all(data[Query]),[c],desc),values(data[Query]))

Drag the Query column and the second measure to the table visual.

Hope this helps.


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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Thanks very much for your help on this!

Ashish_Mathur
Super User
Super User

Hi,

Write these measures

C = sum(Data[Clicks])

Top 5 Query by clicks = calculate([c],topn(5,all(data[Query]),[c],desc),values(data[Query]))

Drag the Query column and the second measure to the table visual.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks very much for your help on this!

You are welcome.


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

Hi @Anonymous 

You can use the top n dax function.
Please refer to the linked tutorial :

https://www.youtube.com/watch?v=vpGAf6Nkt1Q

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.