Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

DAX Challenge

Hi All,   I have the following sales table where I need to find annual ranking of salesperson but there is a small complexity....   The ranking depends not only on number of annual car sales by t...
  • CNENFRNL's avatar
    CNENFRNL
    5 years ago

    Anonymous , I chanced on this video and improved the measure; you might want to refer to it as well,

     

    Annual Ranking =
    VAR __delta = MAX ( Sales[Date of Joining] )
    RETURN
        RANKX (
            ALLSELECTED ( Sales[EMPLOYEE_ID] ),
            CALCULATE (
                SUM ( Sales[Annual Car Sales] ) * __delta + SUM ( Sales[Date of Joining] ),
                ALLEXCEPT ( Sales, Sales[EMPLOYEE_ID] )
            )
        )