Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi
Need Help
I was trying to display rank in a card. Below are the details of I am trying to do.
Below are the measures which I used.
Solved! Go to Solution.
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
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
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
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
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
Thankyou for the quick response. I am sorry actually it was 3 by mistake I mentioned it 4. This was really very helpful🙂.
User | Count |
---|---|
101 | |
90 | |
78 | |
70 | |
69 |
User | Count |
---|---|
110 | |
96 | |
95 | |
74 | |
71 |