Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hwan
Frequent Visitor

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,

1 ACCEPTED SOLUTION
chrisu
Responsive Resident
Responsive 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):

 

attribute slicer.PNG

 

View solution in original post

8 REPLIES 8
chrisu
Responsive Resident
Responsive Resident

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

chrisu
Responsive Resident
Responsive Resident

Depending on your needs, the Attribute Slicer custom visual might work as well.  See https://app.powerbi.com/visuals/.  

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
Responsive Resident
Responsive 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):

 

attribute slicer.PNG

 

hwan
Frequent Visitor

Thank you very much! This slicer works great.

hwan
Frequent Visitor

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

KHorseman
Community Champion
Community Champion

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.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.