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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Custom / dynamic sorting based on slicer value

Hello!

 

I have problem which I don't know how to fix it. I am making report about bus traffic. There are different 6 routes and all of them are using few same bus stops in the middle of the route. I want those stops shown in correct order in Clustered Bar chart based on which of the 6 routes are selected in slicer, and if all is selected then using some "default" sorting order which is somehow correct but can't be absolute correct.

 

There is a picture under this (sorry, it's terrible 😅) to show what I mean.

 

This would be pieace of cake if you could but a measure at the visual axix but that is not allowed. I know how to make basic "index columns" for sorting stuff at Data section and at Query Editor. And then sorting one column based on an other. But problem with in this my case is that there will be duplicates when putting stop_id's and sorting numbers in same columns for all 6 routes. One solution might be to make own columns for each route and their index columns, but I don't know how to "tell" for Bar Chart visual which column it has to use for sorting based on which route is selected for a slicer.

 

Can anyone help me with this please?

 

routes.jpg

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Could you provide a simple PBIX file for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures. I look forward to your response.

 

Best Regards

Community Support Team _ Polly

 

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

Anonymous
Not applicable

Hello

 

Thanks for answering. I made a demo pbix for you but I don't know how to send here. But here is two pictures.

First table contains:

 

  • trip_id (connects to route_id in other table)
  • stop_sequence (unique sequence for stopping order per trip and per stop
  • stop_id for every stop
  • direction_label

What I need is to get stop_id's to correct order based on directions stopping sequence. Every direction has own unique stopping sequence. So when I selected "A to B" from slicer stop_id's in bar charts has to get into correct order. When all directions are selected it does not matter in which order stops then are. Only when single direction value is selected.

 

Second table has stop id's, names and correct stop/sort order but it is manually made in excel so it is fixed. I need dynamical sorting based on direction -> trip_id -> stop_sequence.

 

Thanks!

 

trip_stop_sequence.png

stop_fixed_order.png

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.