Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Rank based off Grouped Figures

Ok so new to Power BI and trying to work my way through. I have Data that I am grouping and Ranking. Yet i can't get my Rank to work. I have tried every method I can find. Any Help would be greatly Appreciated.

 

I have it grouped by Loan Officer and want to Rank by Total Volume . I was using: 

Rank2 = RANKX(All('MTD'[Loan Originator]),'MTD'[Volume],,DESC) but i am getting all 1s 

 

 

Loan OfficerBranch NameLoan PurposeTotal Loan AmountPurchase UnitsPurchase VolumeRefinance VolumeRefinance Units 
A4265 Cash-Out Refinance194,000.00001940001 
A4264 NoCash-Out Refinance210,000.00002100001 
A4265 Purchase2,970.001297000 
A4265 Purchase116,648.00111664800 
A4265 Purchase181,943.00118194300 
B4277 Purchase111,000.00111100000 
C4281Purchase88,270.0018827000 
C4281 Purchase112,000.00111200000 
C4281 Purchase134,830.00113483000 
C4281 Purchase201,286.00120128600 
C4281 Purchase279,837.00127983700 
C4281 Purchase329,985.00132998500 
C4281 Purchase350,000.00135000000 
D4278 NoCash-Out Refinance167,500.00001675001 
D4278 Purchase305,201.00130520100 
D4278 Purchase471,524.00147152400 
         

 

  • Hi Anonymous,

     

    Please create your rank measure using the formula, then create a table visual, you will get expected result.

    Rank = RANKX(ALL(Table1),CALCULATE(SUM(Table1[Total Loan Amount]),ALLEXCEPT(Table1,Table1[Loan Officer])),,DESC,Dense)




    Best Regards,
    Angelia

6 Replies

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Hi Anonymous,

    Your sample table and your formula field name is not consistent, do you want to rank [Total Loan Amount] group by [Loan Officer], right? If it is, please create calculated column using the formula.

    Rank = RANKX(FILTER(Table1,Table1[Loan Officer]=EARLIER(Table1[Loan Officer])),Table1[Total Loan Amount],,DESC)



    If this is not what you want, please share more details for further analysis.

    Thanks,
    Angelia

    • Anonymous's avatar
      Anonymous
      Not applicable

      That does not work. First I get 1 when I use that formula. 2nd the screen shot you shows doesn't have them ranked properly. 

       

      Each Loan Officer should have the same Ranking : A = 3, C=1 etc. 

       

       

       

       

      • v-huizhn-msft's avatar
        v-huizhn-msft
        Microsoft Employee

        Hi Anonymous,

         

        It's till confusing, you need to discribe rank the value based on which column and group by which column. You'd better list your expected result. Just one setence: "Each Loan Officer should have the same Ranking : A = 3, C=1 etc." I don't know to calculate the A=3,C=1? And please please share more details for further analysis.

        Best Regards,
        Angelia