Showing results for 
Search instead for 
Did you mean: 
ozcel600 Frequent Visitor
Frequent Visitor

RANKX returns duplicates

Hi all,


i've searched this forum endlessly, but somehow i can't figure out how to resolve this problem.

I have a table with problem causes (Aanleiding in Dutch) and i want to show only the TOP 5 causes. So i started with simply adding a TOP N to the Aanleiding field, but then i found out that it shows 6 values, because the bottom 2 values are 20 times present in the table. Can anyone please help me out to only show the TOP5?





Stachu Super Contributor
Super Contributor

Re: RANKX returns duplicates

right now you use the visual TopN filter, which probably uses built in rank, not the one you written

instead, can you filter the TOP5 measure, for values that are <=5?
that will work, assuming that the Dense at the end of RANKX give you the ranks with no ties

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

Proud to be a Datanaut!

ozcel600 Frequent Visitor
Frequent Visitor

Re: RANKX returns duplicates

Hi Stachu,


i've removed the TOP N filter as you said and added the TOP5 to the filtering using <=5. But unfortunately it still shows the same 6 items Man Sad

Community Support Team
Community Support Team

Re: RANKX returns duplicates

Hi @ozcel600

If you only want to show Top5 with only 5 values

Modified the formula as below

Measure 2 = IF(HASONEVALUE(Sheet1[as]),RANKX(ALLSELECTED(Sheet1),[Measure],,DESC))

create an index column from 1 in the query editor, then add [Index] column to the Visual Filter container and apply "is less than or equal to 5"




Best Regards


Helpful resources

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 289 members 3,057 guests
Please welcome our newest community members: