Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago

RANKX Issues, been trying everything

I've had a series of issues using RANKX...after many issues I just built a new table.   Now I'm running into the following:

 

The table contains Date, Store Name, Region, Agent ID, Agent Name, and Revenue.  I am trying to rank the agents by the sum of their revenue in a date range selected by a filter

 

I'm using this formula

 

RANKX(ALLSELECTED('Revenue'[AgentID]),CALCULATE(sum('Revenue '[RevenueSum])),,,Skip)
 
This ranks the ID in correct order, but when I add other idenfitying columns to the visual such as store or name they all become ranked as 1
 
I also tried creating a seperate table with unique AgentID and doing it that way, ranking the whole table, also returns everything as 1
 
RANKX(ALLSELECTED('AgentTable'),CALCULATE(sum('Revenue '[RevenueSum])),,,Skip)
 
Any help is appreciated

1 Reply

  • Fowmy's avatar
    Fowmy
    Icon for Super User rankSuper User

    Anonymous 

    Do you have relationship between AgentTable and Revenue table? create the relationship if it's not there. You should be able to add all the fileds if necessary, it will work 

    Rank = RANKX(ALLSELECTED('AgentTable'),CALCULATE(sum('Revenue '[RevenueSum])),,,Skip)