# SANKEY: Force sorting order

**URL:** <https://community.plotly.com/t/sankey-force-sorting-order/61056>\
**Category:** Dash Python\
**Tags:** question\
**Created:** [February 15, 2022, 2:29pm UTC](https://community.plotly.com/t/sankey-force-sorting-order/61056 "2022-02-15T14:29:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgomes\_eu](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jgomes_eu/32/14895_2.png) [@jgomes\_eu](https://community.plotly.com/u/jgomes_eu)\
**Post date:** [February 15, 2022, 2:29pm UTC](https://community.plotly.com/t/sankey-force-sorting-order/61056/1 "2022-02-15T14:29:27Z")

</div>

Hello everyone!

I have the code that generates this dashboard, with a multi dropdown selector, that then generates the Sankey graph.  
The code can be found [**here**](https://github.com/vostpt/ICNF_DATA/blob/main/sankey.py)

 ![newplot (4)](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/8/0/80ff534644f7e33f3185bf4b130c7c56503f9a54.png)

As you can see by the image, everything is working fine except for the order that the first branch is presented, which is the years in the dataset (range from 2013 to 2022)

Apparently plotly is not respecting the sorting order which, in my view, should’t happen.

\*\* Is there any way to force the branches to be generated by sorting order?\*\*

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![jgomes\_eu](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jgomes_eu/32/14895_2.png) [@jgomes\_eu](https://community.plotly.com/u/jgomes_eu)\
**Post date:** [February 17, 2022, 2:15pm UTC](https://community.plotly.com/t/sankey-force-sorting-order/61056/2 "2022-02-17T14:15:24Z")

</div>

@AnnMarieW any ideas? Thank you!
