Forum Discussion
Microsoft Sankey Visual: How can I prevent destination nodes being automatically reordered?
Hi all,
I'm using the Microsoft Sankey visual in Power BI Desktop and would like to keep the node order consistent between the left and right sides of the chart.
My source data is structured as:
| Apples | Apples | 45 |
| Apples | Pears | 7 |
| Pears | Fig | 26 |
| Fig | Cherry | 115 |
| Cherry | Cherry | 13 |
Intended category order:
- Apple
- Pear
- Fig
- Cherry
However, the Sankey visual automatically changes the order of the destination nodes presumably to reduce flow crossings.
I have already tried:
- Creating a numeric sort column (1 = Severe, 2 = Moderate, 3 = Mild, 4 = Normal renal function)
- Using Sort by Column on the destination field (To)
- Creating a separate Category/SortOrder lookup table
- Sorting both the source data and lookup table correctly
- Disabling Auto links reorder in the visual settings
Power BI accepts the sort order without errors, but the Sankey visual continues to reorder the destination nodes.
Manually dragging is not ideal, as the freehand movement does not allow precision. My questions are:
- Does the Microsoft Sankey visual support a fixed destination node order?
- Is there a supported way to force the same category order on both sides of the Sankey
Any advice would be greatly appreciated.
Thanks!
3 Replies
- ShivekMaharaj
Resident Rockstar
Hi Silsil,
I don’t think you’re missing a sort setting here.
The Microsoft Sankey visual does its own node layout, so the order of the destination nodes is not driven reliably by the model’s Sort by column order. That is why your 1 = Apple, 2 = Pear, 3 = Fig, 4 = Cherry column can sort correctly elsewhere in the model but still be ignored by the Sankey.
There also does not appear to be a supported option in the visual to lock the destination nodes into a fixed order. Turning off Auto links reorder affects the links, but it does not give you a fixed node sort order.
So for the exact requirement you have, I see two realistic options:
- Manually position the nodes in the Microsoft visual, which as you mentioned is not ideal if you need repeatable placement.
- Use a visual where node position/order can be explicitly controlled, for example Deneb or another Sankey custom visual that exposes node ordering.
I would not spend more time trying different DAX sort columns here. From what you’ve tested, this looks like the Sankey visual is deciding the node placement itself rather than following the model sort order.AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.
- LumericVisuals
Helper II
confirms it's a known layout-engine limitation of that specific visual, offers the placeholder-link workaround for small category counts, and flags Deneb/Vega-Lite as the real fix if exact ordering matters long-term.
- kiara-mehra35New Member
I have seen something similar occur with Sankey visuals in Power BI; however, what is important to note here is that Sort by Column does not always coincide with the node location.
From the perspective of the semantic model, using a SortOrder column and sorting the To variable is the correct approach. However, Microsoft Sankey visuals may use their own algorithm for nodes placement when creating visuals. The created layout is determined by the relationships and flow structure, which means destination nodes can be moved around to minimize link intersections.
This is also why using a separate dimension table, or sorting the data will not change the resulting visual layout. If the source table is sorted this does not ensure that nodes will occupy a specific coordinate/position vertically.
Also, I’d make a distinction between Auto links reorder option and node sorting. Even disabling this option may influence how links are organized, but it does not mean that nodes will have the definite sort order.
If the condition mandates the existence of an unchanging, precise arrangement on both fronts, then the limitation more likely lies in the visual's layout engine instead of the data model. Under such circumstances, it would be necessary to utilize a Sankey visual which explicitly provides controls for the position of the node and/or layout.
Has someone tried to test the latest Microsoft Sankey visual and find a way to have a reliable destination-node order without positioning the nodes?