RANKX function issue

Babken Hakobyan

New Member
Joined
Aug 31, 2016
Messages
3
[FONT=&quot]Hello,[/FONT]
[FONT=&quot]In PowerPivot I have the following measure: [/FONT]
[FONT=&quot]Sold:=CALCULATE(COUNTA(Database[Status]),Database[Status]="SOLD",Database[Range Status]=1)[/FONT]
[FONT=&quot]Based on that measure I created the following formula:[/FONT]
[FONT=&quot]Sales Rank Score:=RANKX(ALLSELECTED(Database[Agent Name&ID]),[Sold],,ASC)*0.25. So basically i want to have the agents ranked and a relevant weight (in this case it's 25%) applied based on the "Sold" values. Then I create a PivotTable displaying agents in the row field and "Sales Rank Score" as values. I then create a slicer containing ZIP Codes. So now I sort the values in the PivotTable and then select the top ten agents. The scores automatically change and display ranks calculated just for those top 10 agents. Moreover, the RANKX function totally ignores what criteria lie in the "Sold" measure. Then a more strange thing happens: when I clear the top 10 filter, the scores are calculated for all ZIP codes and not just the one selected in the slicer. So my questions are the following:[/FONT]
[FONT=&quot]1.How can I make the RANKX function ignore the top 10 filter in the PivotTable and calculate the ranks only based on the ZIP code selected in the slicer?[/FONT]
[FONT=&quot]2. How can I make the RANKX function take into account the criteria in the "Sold" measure?[/FONT]
[FONT=&quot]I hope I was clear enough. If not, please don't hesitate to ask.[/FONT]
[FONT=&quot]Thank You in advance.[/FONT]
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Ten allselected function is sensitive to filters in your pivot table. Why are you using allselected and not all?
 
Upvote 0

Forum statistics

Threads
1,215,361
Messages
6,124,500
Members
449,166
Latest member
hokjock

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top