Forum Discussion

taiboontam's avatar
taiboontam
New Member
4 years ago
Solved

Index in a Top n Table Visual

Hello everybody,

 

So I want to create a simple 'Top n Customers by Sales Value' visual. There is no index to show whose customers is in which place though. This is what I'm going for...

N-th PlaceCustomer NameSales Value (LCY)
1Customer A125,000
2Customer B110,000
3Customer C87,000
4Customer D63,000
5Customer E29,000

 

What I want is that very first column, but there is also slicers to select the period (month and year) and sales team. So a precalcuated column is not applicable to this, because as soon as you change those parameters, the values wouldn't be correct anymore. I try finding a solution to this for a while now and can't find any. Is there a way to just plonk that column on there?

 

Thanks in advance!

  • v-kkf-msft's avatar
    v-kkf-msft
    4 years ago

    Hi taiboontam ,

     

    Has your problem been solved? If it is solved, please mark a reply which is helpful to you.

    If the problem is still not resolved, please try the following measure:

     

    Rank = 
    RANKX (
        ALLSELECTED ( 'Table'[Customer Name] ),
        CALCULATE ( SUM ( 'Table'[Sales Value (LCY)] ) ),
        ,
        DESC,
        SKIP
    )

     

    Best Regards,
    Winniz


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

4 Replies

  • taiboontam , You can use rank , assume Sales Value (LCY) is a measure

     

    rankx(Allselected(Table[Customer name]), [Sales Value (LCY)],,desc,dense)

     

    you can use visual level filter for 5

     

     

    • taiboontam's avatar
      taiboontam
      New Member

      Ah yeah, the Sales Value is not a measure..... It's just a normal data in a table

      • v-kkf-msft's avatar
        v-kkf-msft
        Icon for Community Support rankCommunity Support

        Hi taiboontam ,

         

        Has your problem been solved? If it is solved, please mark a reply which is helpful to you.

        If the problem is still not resolved, please try the following measure:

         

        Rank = 
        RANKX (
            ALLSELECTED ( 'Table'[Customer Name] ),
            CALCULATE ( SUM ( 'Table'[Sales Value (LCY)] ) ),
            ,
            DESC,
            SKIP
        )

         

        Best Regards,
        Winniz


        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

         

  • Hi,

    I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

    I hope the below DAX measure helps to create a new measure and apply it to your data model.

     

    Rank Nth Place: =
    IF (
        HASONEVALUE ( Customers[Customer] ),
        RANKX (
            SUMMARIZE ( ALLSELECTED ( Data ), Customers[Customer] ),
            [Sales total:],
            ,
            DESC
        )
    )