Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Rank

The rank formula works when SAP Material is the only measure on the row (1st image).  When I add in Sap Material Description it returns all values in the table and adds a rank of "1" to it (2nd image).

 

How do I fix the formula so that i can add more measures to the row field and still get the correct rank?

 

RANK = RANKX(FILTER(ALLSELECTED(PRODUCT_DIM[SAP_MATERIAL]),NOT(ISBLANK([UNITS PROF]))),[Avg Weekly Units],,DESC,DENSE)

 

 

 

 

 

1 Reply

  • Hi,

    I am not sure how your datamodel looks like, but please try something like below.

     

    RANK =
    RANKX (
        FILTER (
            ALLSELECTED ( PRODUCT_DIM[SAP_MATERIAL], PRODUCT_DIM[SAP_MATERIAL_DESCRIPTION] ),
            NOT ( ISBLANK ( [UNITS PROF] ) )
        ),
        [Avg Weekly Units],
        ,
        DESC,
        DENSE
    )