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
Ben1981
Helper III
Helper III

Return field name based on ranking measure

Hi, hoping someone can help me with this one;


I have a table with a list of names, a report page with 5 visual cards and a search box. The idea is that the user can type out a first name usch as Ben and the cards 1-5 will be populated with the first 5 names found within the table if any.

 

To help to do this I have created a rank measure that will rank the list of names based upon the search critieria, so for example if there are 7 Bens in the data with various surnames then it will find all 7 and rank them 1 to 7 but those first 5 will show within the cards.

The rank measure is working fine so that however I filter the table the rank measure will correctly rank the filtered data from 1 to x. What I can't figure out how to do is to get the cards to show the report name based on which are rank 1 to 5.


I have tried to write a DAX measure such as....

Report_01 = 
VAR = _rank = [_Ranking]

RETURN

CALCULATE

  (

     SELECTEDVALUE('table'[name]),

     _rank = 1

)

Obviously this has not worked 😞 If anyone knows how I can do this I'd be in your debt!

1 ACCEPTED SOLUTION
dharmendars007
Super User
Super User

Hello @Ben1981 , 

 

Please give this a try the below measure wher you can pass the ranking measures you have written..

 

TopN_Name =
VAR RankToShow = <index> -- This would be 1 for the first card, 2 for the second, etc.
VAR TopNames =
TOPN(
RankToShow,
ALLSELECTED('table'),[_Ranking], ASC)
RETURN
MAXX(FILTER(TopNames, [_Ranking] = RankToShow),'table'[name])

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

View solution in original post

2 REPLIES 2
dharmendars007
Super User
Super User

Hello @Ben1981 , 

 

Please give this a try the below measure wher you can pass the ranking measures you have written..

 

TopN_Name =
VAR RankToShow = <index> -- This would be 1 for the first card, 2 for the second, etc.
VAR TopNames =
TOPN(
RankToShow,
ALLSELECTED('table'),[_Ranking], ASC)
RETURN
MAXX(FILTER(TopNames, [_Ranking] = RankToShow),'table'[name])

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

Top marks, works a treat! Thank you 🙂

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