Forum Discussion

ppgandhi11's avatar
ppgandhi11
Icon for Helper V rankHelper V
8 years ago
Solved

group by help in creating rank

Hi,

 

I have below fields in my query.

 

ProviderNPI - field

Total Amount Paid - measure

Specialty - field

 

I want to create a rank of top 10 highest paid providerNPI within each Specialty.  How would I create such a rank?

 

If there are only 3 specialty, then I want to list max 30 ProvierNPI (10 for each) that have max Total Amount paid. Any help is appreciated. Thanks!

  • Hi ppgandhi11,

     

    Please try this measure:

    Rank = RANKX(ALLEXCEPT(Query1,Query1[Specialty]),[TotalPaid],,DESC)

     

    Best regards,

    Yuliana Gu

9 Replies