cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vengadeshpalani
Helper III
Helper III

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 @vengadeshpalani,

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 @vengadeshpalani,

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

othy_bi
Helper V
Helper V

Hi @vengadeshpalani 

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
Super User II
Super User II

@vengadeshpalani 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 here


Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors