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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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