Forum Discussion

CourtneyB's avatar
CourtneyB
Frequent Visitor
8 years ago
Solved

RANKX Help!

Hi Everyone,

 

I am hoping someone can help me becausebecause this RANKX is really giving me a run for my money. I am fairly new to Power Bi and have been teaching myself as I go and I have hit a wall with this one. I need to rank different companies average turn times (i.e. how long it took them to deliver the product from start to finish) from lowest to highest time by state. Any help is much appreciated. 

 

 

 

  • CourtneyB's avatar
    CourtneyB
    8 years ago

    Hi All, 

     

    So, my boss was able to figure it out. the correct formula to use for my case is the following:

     

    Rank = RANKX(ALLSELECTED('2821_410_700_150'[CompanyName]), CALCULATE(AVERAGE('2821_410_700_150'[TT100150_CD])),,ASC,Dense)-1

     

    Thank you for all your imput and assistance.

12 Replies

  • CourtneyB's avatar
    CourtneyB
    Frequent Visitor

    Example of what I am looking to accomplish except a new column would be entered with the rankings

      • CourtneyB's avatar
        CourtneyB
        Frequent Visitor

        DAX0110 I didnt have anything established as i kept getting errors but with mattbrice's formula and adding Average() it just gave me all Rank 1s. I dont know if it makes a difference but each row in the data gives the order level Turn Time, so when i pull that field into the matrix i have it average instead of sum.

         

        Rank = RANKX(ALL('2821_410_700_150'[CompanyName]),AVERAGE('2821_410_700_150'[TT100150_BD]))

         

    • mattbrice's avatar
      mattbrice
      Solution Sage
      RANKX ( ALL (Table[Company] ), [Avg Tat BD] )
      • CourtneyB's avatar
        CourtneyB
        Frequent Visitor

        mattbrice it is not allowing me to enter the [avg TAT BD]. In the matrix, i have the TAT BD to average and not sum if that makes a difference?