Forum Discussion

hwan's avatar
hwan
Frequent Visitor
10 years ago
Solved

Sorting slicer by revenue

Hello,

 

I have a fact table with client info and revenue $ and a client dimension table. I would like to have a slicer for client names but would like the client name sorted by revenue on the slicer. Is it possible?

 

Thanks,

  • Yes, you would add Client Name as your Category and Revenue as your Values.  You can then sort by Values or alphabetically by client name.  This screenshot from the example file shows the sorting in action (the example file can be downloaded from the custom visuals page I linked to above):

     

     

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Possible? Maybe. Probably not practical though.

     

    You would need to create a calculated column on the client table that contains the client's revenue. You would need to do this in a way that does not reference the client name column (so I hope the revenue table has a client ID number or something like that instead). You would then use this revenue column as the sort order for the client name column (Sort By Column, under the modeling tab). However, all this would only work if each client's revenue were a unique number not shared by any other client. Or if you wrote your formula in such a way as to combine the revenue with something else so that the sort order is the same but each value is forced to be unique.

    • hwan's avatar
      hwan
      Frequent Visitor

      Thanks KHorseman! I've tried the approaches you proposed and agree it is not very practical. However it gives me some ideas on how to set up the data model in the future. Appreciate your help!

    • hwan's avatar
      hwan
      Frequent Visitor

      Thanks Chrisu. Do you have a particular visual you recommand? The revenue amount can be quite different from client to client.

    • hwan's avatar
      hwan
      Frequent Visitor

      Sorry Chrisu I didn't read your message right the first time. The Acctribute Slicer seems very helpful and I wonder if there is a way to sort the category display? In my case if I use revenue as attribute can I sort client names displayed based on revenue amount?

      • chrisu's avatar
        chrisu
        Icon for Responsive Resident rankResponsive Resident

        Yes, you would add Client Name as your Category and Revenue as your Values.  You can then sort by Values or alphabetically by client name.  This screenshot from the example file shows the sorting in action (the example file can be downloaded from the custom visuals page I linked to above):

         

         

  • chrisu's avatar
    chrisu
    Icon for Responsive Resident rankResponsive Resident

    Bah, posted again after receiving an error message the first time.