Forum Discussion
Rank in a card
Hi
Need Help
I was trying to display rank in a card. Below are the details of I am trying to do.
- Below is the Table I have Company names and sales. One company has different names so I ranked first based on all companies and then tried to filter Nike rankings to get the top rank among the Nike company.
Below are the measures which I used.
- Anonymous3 years ago
Hi kompalli ,
I updated my sample pbix file(see the attachment), please check if that is what you want. It return 3 not 4, I'm not sure if it is correct or not...
NIKE Sales Ranking = RANKX ( ALL ( Company ), [Total sales] )Measure = VAR _tab = SUMMARIZE ( 'Company', 'Company'[Market/Nike], 'Company'[Company], "@totalsales", [Total sales], "@rank", [NIKE Sales Ranking] ) RETURN MINX ( FILTER ( _tab, Company[Market/Nike] = "NIKE" ), [@rank] )Best Regards
6 Replies
- AnonymousNot applicable
Hi kompalli ,
What's your expected result? Do you want to get the rank value or the sales which the rank is 1? Since you only need to get the top 1 customer, then the rank value should be 1. If you want to get the sales which the rank is 1, you can create a measure as below to get it:
Measure = VAR _tab = SUMMARIZE ( 'Company', 'Company'[Market/Nike], 'Company'[Company], "@totalsales", [Total sales], "@rank", [NIKE Sales Ranking] ) RETURN MAXX ( FILTER (_tab, [@rank] = 1 ), [@totalsales] )If the above one can't help you get the expected result, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
- kompalli
Helper I
Hi Anonymous
Thanks for you quick response, The method you followed is exactly what I need but I want to show top Rank of Nike in the card and not the sales value or company name. Can that be done.
Thanks in advance
- AnonymousNot applicable
Hi kompalli ,
I'm not clear about your requirement, could you please provide the exact value which you want to display in the card visual finally base on the below table data?
Best Regards