The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!
Solved! Go to Solution.
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
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
Top marks, works a treat! Thank you 🙂