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

Finding Best graded serial number for each part number

I have a table with that contains a columns for Part Number, Grade (lower number = better), and Serial Number.  I would like to Rank each serialized version per part part number.  Then to be able to show the best serial number for each part number.  In the screen shot below I manually filter the Best Parts by grade to show what I am looking for. 

rayhull_0-1670939058632.png

 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @rayhull 

According to your description, you want to filter the Best Parts by grade.

Here are the steps you can refer to :
(1)My test data is the same as yours.

(2)We can create a measure:

Measure = 
var _curPart = MAX('Table'[Part])
return
RANKX(FILTER( ALL('Table'),'Table'[Part]=_curPart)  , CALCULATE( SUM('Table'[grade])),,ASC,Dense)

Then we can test in the visual:

vyueyunzhmsft_0-1670985114101.png

(3)Then we can configure the measure on the "Filter on this viusal", and we can meet your need:

vyueyunzhmsft_1-1670985156241.png

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @rayhull 

According to your description, you want to filter the Best Parts by grade.

Here are the steps you can refer to :
(1)My test data is the same as yours.

(2)We can create a measure:

Measure = 
var _curPart = MAX('Table'[Part])
return
RANKX(FILTER( ALL('Table'),'Table'[Part]=_curPart)  , CALCULATE( SUM('Table'[grade])),,ASC,Dense)

Then we can test in the visual:

vyueyunzhmsft_0-1670985114101.png

(3)Then we can configure the measure on the "Filter on this viusal", and we can meet your need:

vyueyunzhmsft_1-1670985156241.png

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

amitchandak
Super User
Super User

@rayhull , Create a column rank and filter for 1 in the measure of visual

 

rankx(filter(Table, [part] =earlier([part])  ), [Grade],,asc,dense)

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

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
Top Kudoed Authors