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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Need to add rank in table

Hi All,

 

I have data like below table, i want to add Top N Invoice Filter

 

vengadeshpalani_0-1619008266745.png

 

output : want to create Rank by Invoice, and also want to add Rank and Top N filter in below Table

 

vengadeshpalani_1-1619008325132.png

 

Thanks,

Vengadesh P

 

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

Hi @Anonymous,

I think you need a unique field that used to combine with the amount field for ranking or it is hard to accurately filter only top n records. (for the same values)

Add an index column (Power Query) - Excel (microsoft.com)

Sorting by multiple columns 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

I think you need a unique field that used to combine with the amount field for ranking or it is hard to accurately filter only top n records. (for the same values)

Add an index column (Power Query) - Excel (microsoft.com)

Sorting by multiple columns 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
DataVitalizer
Super User
Super User

Hi @Anonymous 

Create these two calculated columns and you will get the desired result:

Rank= RANKX(Table,Table[Sales AMT])
Top 5 Filter= VAR c=RANKX(ALL(Table),Table[Rank],,ASC) return IF(c<=5,1,0)

 

Did it work ? Mark it as a solution to help spreading knowledge.

A kudos would be appreciated  

negi007
Community Champion
Community Champion

@Anonymous You can create a custom column in your data like below

 
Rank = RANK.EQ('Table'[Value],'Table'[Value],DESC)
 
Rank_top = if('Table'[Rank]<=5,"Yes","No")
 

 

negi007_0-1619009925762.png

 

 

 




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



Proud to be a Super User!


Follow me on linkedin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.