Forum Discussion

davehus's avatar
davehus
Icon for Memorable Member rankMemorable Member
7 years ago
Solved

Rank by Department Only

Hi,

 

I have a problem with Rankx that I'm trying to overcome. I have a database of product sales by store. I want to get the product rank by department but want to retain the rank when I add a store column in.

 

I also have a year filter on the table. Example table attached.

 

Thanks - D

  • Hi davehus ,

     

    Would you like something like it in the snapshot below? Please download the demo from the attachment.

    Measure =
    CALCULATE (
        RANKX (
            ALL ( Table1[Product Code & Description] ),
            CALCULATE ( SUM ( Table1[Sales] ) )
        ),
        ALL ( Table1[Branch Name] )
    )
    

    Rank-by-Department-Only

     

    Best Regards,

2 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi davehus ,

     

    Would you like something like it in the snapshot below? Please download the demo from the attachment.

    Measure =
    CALCULATE (
        RANKX (
            ALL ( Table1[Product Code & Description] ),
            CALCULATE ( SUM ( Table1[Sales] ) )
        ),
        ALL ( Table1[Branch Name] )
    )
    

    Rank-by-Department-Only

     

    Best Regards,