Forum Discussion

DPJay's avatar
DPJay
Regular Visitor
7 years ago
Solved

Top N Filter

Hello,

 

I'm trying to rank locations based on a dynamic Top N filter using parameters. It seems to work if I have only loc2_name in my table view but when I add the location&state field as well to the view the ranks are shown as 1 . Can anyone help me on what I'm missing here.

 

  • Hi DPJay

    As tested, when all columns added to the Table visual is set as "don't summarize", create a measure as below may works

    Note: compare with yours, please pay attention to the bold character.

    Measure = IF(HASONEVALUE(Table1[late]), RANKX(ALL(Table1),[value],,DESC))

     

     

     

    Best Regards

    Maggie

3 Replies

  • rajulshah's avatar
    rajulshah
    Resident Rockstar

    Hello DPJay,

     

    Can you please share the formula for measure used for the rank?

    • DPJay's avatar
      DPJay
      Regular Visitor

      Hello,

       

      Rank Measure = IF ( HASONEVALUE ( FINAL_TBL[location&state] ), RANKX ( ALL (FINAL_TBL[location&state]), [TOT_QTY] ) )

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

    Hi DPJay

    As tested, when all columns added to the Table visual is set as "don't summarize", create a measure as below may works

    Note: compare with yours, please pay attention to the bold character.

    Measure = IF(HASONEVALUE(Table1[late]), RANKX(ALL(Table1),[value],,DESC))

     

     

     

    Best Regards

    Maggie