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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
HadasSpier
Helper I
Helper I

Filter page by top 10 occurrences of values in text field

Hi everyone,

I want to filter the page in my Power B.I report by the 15 entries that appear most in a text field.

For Example:

CategoryTechnologyVendor
Hadassomethinga
Livnesomethingb
Hadassomethinga
Rotemsomethinga
Hadassomethingc
Livnesomethinga
Rotemsomethingb
Rotemsomethingc
Livnesomethinga


In this example, if I wanted the top 2 vendors, I want to see only the rows that the vendor value is a or b.

 

Thank you!

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @HadasSpier ,

 

According to your needs, I did the following test and created two columns, one to mark the rows of a and b, and the other to count the number of their corresponding rows. Then put the col_count field in the Filter to filter the top 2 suppliers through TopN and display the corresponding rows, and the expected results are as follows:

Column = IF('Table'[Vendor] IN {"a","b"} ,1,blank())
Col_count =
CALCULATE (
    COUNT ( 'Table'[Column] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Vendor] = EARLIER ( 'Table'[Vendor] ) )
)

v-henryk-mstf_0-1617012281883.png

 

Here is the sample pbix file.


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

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

View solution in original post

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @HadasSpier ,

 

According to your needs, I did the following test and created two columns, one to mark the rows of a and b, and the other to count the number of their corresponding rows. Then put the col_count field in the Filter to filter the top 2 suppliers through TopN and display the corresponding rows, and the expected results are as follows:

Column = IF('Table'[Vendor] IN {"a","b"} ,1,blank())
Col_count =
CALCULATE (
    COUNT ( 'Table'[Column] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Vendor] = EARLIER ( 'Table'[Vendor] ) )
)

v-henryk-mstf_0-1617012281883.png

 

Here is the sample pbix file.


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

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

I succeeded,

Thank you!!!

amitchandak
Super User
Super User

@HadasSpier , You can filter TOPN at the page level (TOPN on using a measure). It can be done at a visual level or a measure can be created

 

https://www.youtube.com/watch?v=QIVEFp-QiOk

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

This example shows TOPN on a number type data field.


I need the top 15 values that appear the most times in a text data field, without any connection to another column.

 

I didn't find any example for this situation.

Thank you for your time!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors