Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi!
I am currently working on a report that I want to be sorted based on a filter.
The report shows train stops and capacity per each train stop along a trainroute (you can only filter by one route at a time).
It is a line and stacked column diagram.
The train can move two directions: D1 and D2, you can only filter by one of these at a time.
D1 goes from A to D and stops at station A, B, C, D
D2 goes from D to A and stops at station D, C, B, A
The train will stop along the same stations both ways, and here comes my problem:
Is there a way that when you select to filter it by D1, that the chart shows the order of the trainstops like this:
A, B, C, D, and then when you select to filter it by D2, it changes sorting to descending in the chart, and it puts D to the left in the X-axis and A to the right?
I have tried bookmarks and buttons, but it does not do the trick, as it also goes back to the filter that was applied in the bookmark. I want it to be a conditional sorting, so that when you chose to filter it by one of the directions, it changes, and not go back to the filter that was applied for the bookmark.
Hope someone can help me 🙂
Solved! Go to Solution.
Hi, @cillepersille ;
You could copy two identical Visuals, one ordered by A,B,C,D, and the other ordered by D,C,B,A. Then put it in a different place on a page; Then create a slicer, D1 and D2. And then measure it:
1.copy two visuals.
2. enter the D1,D2 table.
3.create a measure.
Measure = IF(MAX('slicer'[Slicer])="D1",1,0)
4.then apply it into filter.two Visuals one for 1 and one for 0.
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you, @v-yalanwu-msft !
This looks a lot like the solution I have currently ended up with, but I actually ended up putting the visual on two different pages in the report (one that I made invisible). What I ended up doing, was create a page called trains D1 and duplicated the page and called that D2.
The D1 page is filtered by trains going in the D1 direction and the filter is locked, while the visual is sorted by descending. They are also only allowed to filter by one train route at a time. On the page there is a button that says "R2", and if they click there, they go to the next page, where the visual is sorted ascending, and the filter applied from page D1 stays on in page D2.
It works very fine and it looks good 😄
Hi, @cillepersille ;
I'm glad you found the right solution. Congratulations.Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you!
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @cillepersille ;
You could copy two identical Visuals, one ordered by A,B,C,D, and the other ordered by D,C,B,A. Then put it in a different place on a page; Then create a slicer, D1 and D2. And then measure it:
1.copy two visuals.
2. enter the D1,D2 table.
3.create a measure.
Measure = IF(MAX('slicer'[Slicer])="D1",1,0)
4.then apply it into filter.two Visuals one for 1 and one for 0.
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you, @v-yalanwu-msft !
This looks a lot like the solution I have currently ended up with, but I actually ended up putting the visual on two different pages in the report (one that I made invisible). What I ended up doing, was create a page called trains D1 and duplicated the page and called that D2.
The D1 page is filtered by trains going in the D1 direction and the filter is locked, while the visual is sorted by descending. They are also only allowed to filter by one train route at a time. On the page there is a button that says "R2", and if they click there, they go to the next page, where the visual is sorted ascending, and the filter applied from page D1 stays on in page D2.
It works very fine and it looks good 😄
You cannot sort a column by a measure, only by another column ( in the same table!)
You can achieve your goal with a fully customized visual based on measures, with each measure representing a station slot, but where the first measure can represent A or D, the second B or C etc.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!