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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
KMcCarthy9
Helper V
Helper V

Using RANKX for TOP 15% Not Working

I have a table that holds uniqueasset and asset age and I am trying to create a dynamic filter in order to show the Top 15% of the oldest assets. I created a uniquerank column since there are many duplicates of asset age.

Measures created:

 

UniqueRank = 
RANKX(
    Data,
    Data[asset age] * 1000000 + Data[Index],
    ,
    DESC,
    DENSE
)

TotalAssets = COUNTROWS(ALL(Data))

Top15PercentCount = CEILING([TotalAssets] * 0.15, 1)

Top15PercentThresholdRank = 
CALCULATE(
    MAXX(
        TOPN([Top15PercentCount], ALL(data), data[UniqueRank], DESC),
        data[UniqueRank]
    )
)

 

 

I then created a column to use as a filter:

 

IsTop15Percent = 
IF(
    MAX(data[UniqueRank]) <= [Top15PercentThresholdRank],
    1,
    0
)

 

However, when I use as a filter it is placing all assets/rows into the Top 15% when I believe it should be flagging 1,876 of them. 

 

What am I doing incorrectly? pbix file here: Top 15 Percent Oldest Assets 

 

TIA! 

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1739923798548.png

 


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

View solution in original post

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1739940388866.png

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1739940388866.png

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

@Jihwan_Kim This works! Thanks so much! 

Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1739923798548.png

 


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

@Ashish_Mathur Your method also appears to work, however I did not try it in my actual data model, but your example is correct. Thank you! 

 

You are welcome.


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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors