Forum Discussion

khappersett's avatar
khappersett
Resolver I
8 years ago

RANKX Trouble

I have struggled with ranking on many reports and can usually get it working but can't seem to get it this time.

 

I want to rank accounts by revenue and also items by revenue. I have the measure working for accounts, It is simply:

 

 

Corp Rank = rankx(ALLSELECTED('Account Detail - Bookings'[CORP_NAME]), [2017 YTD Booked$])

 

 But when I copy the exact same format and try to rank my items, I am getting all 1s or just completely incorrect rankings.

 

 

Item Rank = rankx(ALLSELECTED('Item Master'[item_id]), [2017 YTD Booked$])

 

I have tried using "ALL" instead of "ALLSELECTED", tried wrapping my [2017 YTD Booked$] measure in an ALLEXCEPT with filters, in a CALCULATE, and still can't seem to get it working. I don't understand why it works without any issues for ranking the accounts but doesn't work for my items. Here is a picture of that portion of the data model...

 

 

3 Replies

    • khappersett's avatar
      khappersett
      Resolver I

      GabrielSantos

       

      2017 YTD Booked$ = Calculate(sum('Order Detail - Bookings'[BookedDollars]),DATESYTD('Date Table'[Date].[Date]))

       

      The item rank seems to work when I create a table with just item_id, item rank, and 2017 YTD Booked $. Not sure yet what is causing the issue in my report table, which has many other columns