Forum Discussion

nardtmo's avatar
nardtmo
Icon for Helper III rankHelper III
2 years ago

Ranking issue

Hi everyone,

 

i have this table with desired ranking output column 

rank based on  points_SA (desc) and rerank every date change. 

 

dax formula below is working but not giving me the desired output.

note: points_SA is a measure

 

 

appreciate the help!! thanks in advance

 

Rank_SA_pt =
RANKX(
    FILTER(
        ALL(date),
        [Points_SA] <> BLANK() && [Points_SA] <> 0
    ),
    [Points_SA],
    , DESC, Dense)

 

Market IddatePoints_SARankoutput should be
texas4/16/2024 0:00111
Miami4/16/2024 0:000.722
Philadelphia4/16/2024 0:000.722
North Carolina4/16/2024 0:000.722
New York4/16/2024 0:000.635
New England4/16/2024 0:000.635
New Jersey4/16/2024 0:000.635
Los Angeles4/16/2024 0:000.548
Washington DC4/16/2024 0:000.548
San Francisco4/16/2024 0:000.3510
California4/16/2024 0:000.1611
texas4/17/2024 0:00111
Miami4/17/2024 0:000.722
Philadelphia4/17/2024 0:000.722
North Carolina4/17/2024 0:000.722
New York4/17/2024 0:000.635
New England4/17/2024 0:000.635
New Jersey4/17/2024 0:000.635
Los Angeles4/17/2024 0:000.635
Washington DC4/17/2024 0:000.549
San Francisco4/17/2024 0:000.3510
 California4/17/2024 0:000.1611
texas4/18/2024 0:00111
Miami4/18/2024 0:000.722
Philadelphia4/18/2024 0:000.722
North Carolina4/18/2024 0:000.634
New York4/18/2024 0:000.634
New England4/18/2024 0:000.634
New Jersey4/18/2024 0:000.634
Los Angeles4/18/2024 0:000.548
Washington DC4/18/2024 0:000.548
San Francisco4/18/2024 0:000.3510
 California4/18/2024 0:000.2611

2 Replies

  • thanks Greg. Another pespective  have two rankings, determine rank SA pt change in values and set the switch condition..  other words cant figure it out. Appreciate the help

    Market IdRank_MR7_SARank_SA_ptif Rank_SA_pt row2=row1condition
    Atlanta11FALSEfalse keep using col D1 values
    Miami22FALSEfalse keep using col D2 values
    Philadelphia32TRUEtrue and stay true use D2 until false
    North Carolina42TRUEtrue and stay true use D2 until false
    New Jersey53FALSEfalse keep using col D6 values
    New England63TRUEtrue and stay true use D6 until false
    New York73TRUEtrue and stay true use D6 until false
    Washington DC84FALSEfalse keep using col D9 values
    Los Angeles94TRUEtrue and stay true use D9 until false
    San Francisco105FALSEfalse keep using col D10 values
    Southern California116FALSEfalse keep using col D11 values