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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
nandanu
Frequent Visitor

How to display Top 10 rows in a table visual after filtering by a visual filter

Hi All,

 

I need to display Top 10 values in a table visual where:
(1) the rows are filtered by a visual filter with a complex measure "IncludeInTable"

(2) and then display the top 10 rows from that filtered set.

 

This is what I'm trying.

 

nandanu_0-1685262084737.png

The problem is that it's doing the reverse. The table is first applying the Top N filter and then applying the visual filter for IncludeInTable. As a result, only those rows in the top 10 rows for which IncludeInTable evaluates to 1 are being displayed.

 

How do I achieve the desired result? Your help is most appreciated.

 

Thanks,

Nandan

3 REPLIES 3
ValtteriN
Super User
Super User

Hi,

You can combine the top 10 logic with your filter measure. E.g.

Demo data:

ValtteriN_0-1685282675034.png

Filter measure: (just an example)

Filter for top 10 = IF([Average metric]<>0,1,0)

Filtered table:
ValtteriN_1-1685282717338.png

Now I will get top 3 based on ranking, but the same logic will apply for top 10.

Dax: 

Filter top 3 = IF([Filter for top 10]=1 && RANKX(ALLSELECTED(Ranking),Ranking[Average metric])<=3,1,0)

End result:
ValtteriN_2-1685282888697.png


Summary: instead of using pre-built top filter use RANKX function combined with your filter measure. This way the filters can be applied with one measure.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @ValtteriN ,

 

Thanks for your help with this. I had tried the ranking approach but the requirements are slightly different.

 

My filtered dataset is something like this.

 

nandanu_0-1685297232531.png

 

How do I displayTop 10 Lost Policies in one table visual, Top 10 Bound Policies in another table, Top 10 Incomplete Policies in another etc?

@ValtteriN ,

 

Your suggestion lead me to the solution. I modified my Ranking measure to wrap the RankX inside a calculate which runs the ranking over a filter that only includes either "Lost", or "Bound" or "Quoted" etc.

 

Many thanks for your help. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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