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! Learn more

Reply
Anonymous
Not applicable

TopN fix as 5 where the values are same

Hi All,
Here is a proble statement, on the below picture i want to show only five account based on rating and account as Asc order. where the rating of each account is same.
I use TopN as 5 but it is returning 10 account.
How do i fix the same.

anilkapkoti_0-1680415532968.png

 

 

5 REPLIES 5
FreemanZ
Super User
Super User

hi @Anonymous 

TOPN filter like this can't handle ties. Try to filter with a measure. 

 

Supposing your data looks like:

FreemanZ_0-1680439991418.png

 

try to plot a visual table with the two columns and filter with a measure like:

Measure = 
VAR _table =
TOPN(
    5,
    ALL(TableName),
    TableName[Rating],
    ASC,
    TableName[Item],
    ASC
)
VAR _top5list = SUMMARIZE(_table, TableName[Item])
RETURN
IF(
    MAX(TableName[Item]) IN _top5list,
    1, 0
)

it works like:

FreemanZ_1-1680440163284.png

 

Anonymous
Not applicable

Hi @FreemanZ 

Thanks for your quick response.

If we have two tables one is fact where the rating is available and we have a dimension table where items are stored.
then in that case how to modify the same measure.

 

 

hi @Anonymous 

how are the two tables related?

Anonymous
Not applicable

Hi @FreemanZ 
These two Tables are connected to each other with one to many relationships and there are more items.

andhiii079845
Solution Sage
Solution Sage

I think if 5.0 is the highest rating and more than 5 ppl will have this rating, than PBI show all ppl with rating 5.0.

How should PBI filter this 10 ppl to get 5 ppl? This is not possible. 





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

Proud to be a Super User!




Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.