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
zahra
Regular Visitor

Make slicer of topN rows that have same value

I have table with 30 column and 200 rows. IN 'prob' column (1) value repeated 66 times and (2) repeated (30) times, how  i can make slicer based on top100 . means make slicer that when i put on 100 choose only 66 first row of that comtain 1 and 34 row that contain number of 2 .  I used of RANKX for make ranking but still i have 66 number 1 and t rank 67 for first time that 2 appear.

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

Hi @zahra

 

You can try to add restriction when using rankx :Dense

Measure = IF(HASONEVALUE(Table2[Prob]),RANKX(ALL(Table2),Table2[Prob],VALUES(Table2[Prob]),ASC))

Measure 2 = IF(HASONEVALUE(Table2[Prob]),RANKX(ALL(Table2),Table2[Prob],VALUES(Table2[Prob]),ASC,Dense))

Result:

2.png

If it is not your case, please share pbix or some data sample and expected output. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.

 

Best Regards,

Lin

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

Thanks. But i need somethings like this. index column should be dependent to rank_probility

2.PNG

hi,@zahra

By your description ,if you want to rank even if the values are same ? You can try to use Edit Queries -> Add column ->Index Column function
Step1:
Click Edit Queries and Sort Ascending the Prob column
Step2:
Click Index column (create a new column with an index column starting at 0, you can also custom start at any number)
Step3:
Click Close & Apply and you will get the result
image001.jpgimage002.jpg
 
If it is not your case, Would you like to achieve the result by RANKX ? or please describe the expected output in detail.
Best Regards,
Lin
Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors