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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MOHI
Frequent Visitor

How to sort a slicer dynamically

Hi Team,

We have a slicer(Inventory) and want to sort this based on a meausre(Total Volume of Inventory). 

I tried to sort this by Volume Column in column tools but thats not working and I downloaded custom slicer from more visual section but thats not ideal.

Your help will be appreciated.

Thanks,
Moh

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @MOHI 
Unfortunately, we don't have an option to sort slicers by measures.

There is an idea about this issue , you can vote for it here :

https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=c2a48691-43a6-4442-9f7a-d55fbc2f5e67

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

@MOHI I see why you are getting error, what you mean by this:

 I used products column in calculated quantity column.

 

Please provide as much information as possible otherwise we will be wasting each other's time.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

MOHI
Frequent Visitor

OKAY Im going to explain everything here and see if it makes sense, Sorry for my ambiguous information.

MOHI_0-1694576796288.png

FROM whole dataset we got two columns and I'm developing a dashboard
Here I'm selecting PART_NO in slicer and its 700+ parts. I'm trying to sort this slicer based on INVOICED_QTY. 

MOHI_1-1694577033426.png

I tried to sort through coumn sorting but I didnt work... (getting PART_NO repeated in slicer)

Then I used  calculated coulmn for to get the sum of INVOICED_QTY for each PART_NO


Volumeee =
VAR THISPART = [PART_NO]
RETURN
CALCULATE(
    SUM('All'[INVOICED_QTY]),
    ALL('ALL'),
    'All'[PART_NO] = THISPART
)

And tried to sort through this calculated column but that giving me "circular depency error" because I used PART_NO coulmn in calculated column.

Meausure is there which I used this to calculate sum of INVOICED_QTY but its not helpful to sort slicer.

Thats the whole info I got here.
My question is
Is there anyway to sort slicer through DAX or someother way to acheive this above goal?

Thank you for your time.



parry2k
Super User
Super User

@MOHI question, Why in your post you mentioned sorting based on a measure?

 

2nd, what happens if you try to sort it by quantity? What message/error you are getting?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

MOHI
Frequent Visitor

Hi @parry2k ,

So first I was only trying to sort with measure but in the way I got calculated column aswell. 
My goal is to sort slicer either way,

It doesnt allow anyway based on measure, when I try to sort with calculated column it gave me "circular depency error" because I used products column in calculated quantity column.

Do you see  any solution here.

Thanks

parry2k
Super User
Super User

@MOHI Just realized volume is a measure. 

 

Let me ask a different question, What is the volume measure? and what you want to sort? There could be a potential solution (convoluted one) but need to understand it a bit more.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

MOHI
Frequent Visitor

Hi @parry2k ,

Thanks for your reply,

So I got 1 "Products" column and there is 2 coumn "Quantity" call it volume.

I want Products in Slicer according to the number of sales in 2 clumn. I tried column sorting based on quantity column but didnt work and I tried calculated quantity column which is giving circular depencies error.

Yes I want to sort products in slicer based on quantity.

Thanks for your help.

parry2k
Super User
Super User

@MOHI based on your question, seems like you have volume as a column in the table that you want to use for the sorting, correct?

 

2nd question, you want to sort products based on the volume, correct?

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Ritaf1983
Super User
Super User

Hi @MOHI 
Unfortunately, we don't have an option to sort slicers by measures.

There is an idea about this issue , you can vote for it here :

https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=c2a48691-43a6-4442-9f7a-d55fbc2f5e67

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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