Forum Discussion

spompeo's avatar
spompeo
New Member
7 years ago

RANKX Player Position Rank over Time

Farily new with DAX and struggling with filtered RANKX. I have a StatsDB table and a playerkey table for a fantasy football database I'm working on.

 

Each row of the data table is a game log for a player:

 

StatsDB:

  • PlayerID (relation)
  • Year
  • Name
  • Position
  • Team
  • Week
  • Pass Attempts
  • Pass Completions
  • etc. - Other relevant offense statistics. 

PlayerKey

  • PlayerID (relation)
  • Player Name
  • Current Position

I created measures that calculate fantasy points based on stats. 

 

Example Measures:

  • FPTS Rush Yds:=CALCULATE(sum([Rush Yards])*.1)
  • FPTS Total:=[FPTS Fumb Lost]+[FPTS Rush Yds]+[FPTS Pass TDs]+ etc.

 

I have a points rank that seems to work for the context of the pivot / slicers - 

  • FPTS Rank:=if(not(ISBLANK([FPTS Total])),rankx(filter(all(PlayerKey),not(isblank([FPTS Total]))),[FPTS Total]),blank())

 

However, my goal is to have a "fantasy points positional rank" measure. Where did a player rank in fantasy points scored at his position over any given period of time?

 

Any ideas how to go about this? Would be much appreciated! I can do this manually but am trying to work positional ranks into the data model and am stuck.

1 Reply

  • v-frfei-msft's avatar
    v-frfei-msft
    Community Support

    Hi spompeo ,

     

    Could you please share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.