I going to make a crazy guess: think you're creating too many Polygons, and changing the order of your dimensions in the marks card changes the order in which the polygons are filled.
Try this exercise:
- Turn the color to almost transparent-- you'll see many overlapping polygons.
- Now change the chart type from polygon to circle (this works best if you increase the size of the circle and reduce the width). This is a very useful visualization, because swapping the order of the marks makes no difference. What it WILL show is how the order in which lines overlap changes.
- You'll also see each region has 5 lines: Is this how many you need? Or do you need just 2? It's possible you're creating too many polygon lines, and changing the order in which they are grouped.
I admittedly don't know much about polygons or drawing with lines with Tableau. But just playing with the LINE function in your viz (and with my wealth of dot-to-dot experience gained from some of the finest restaurant place mats), it seems like there needs to be a particular order to the dots:
Cruse across the top (from L to R), join with bottom, cruise along the lower curve, join with the top, color in.
Otherwise, you'll be bouncing up and down-- or something potentially weirder (like when you move COLOR down a notch-- suddenly you have TRIDENTS!)
As Ken Flerlage pointed out, there's some "funkiness" going on in your formulas. I'd make sure your Sankey Polygon is just creating the bare number of line segments for each region and then (knock on wood) your sort order should sort itself out
To maybe give a little more weight to Ken Flerlage's observation, look what happens when we change your mark type to circles and set Dimension 2 to be the same as Dimension 1 (Region, Region); we get something like this:
To my untrained eye, these secondary lines seem suspicious. If we're comparing like with like, shouldn't all lines be horizontal? This would suggest (as Ken's saying, I think) that something may be amiss in one or more of your calculations.
Here's a different way of looking at it: I transformed your viz into a dual axis graph show I could assign different colors per side (dimension 1 and dimension 2). I set Dimension 1 as Region and Dimension 2 as Category.
As we focus on the LEFT side and we highlight through the Regions (South, Central, East, West) we see just what we're after: separate, non-overlapping "stacks." Each has 3 branches (one per Category - Dimension 2).
But as we cycle through the Categories (the right side of the axis), we realize there's a problem:
Technology looks OKAY: four branches on the left (one per unique Region) and one stack on the right. But our right stack is overlapping.
Moving to Furniture:
...we see non-overlapping branches on the left, but our right-side stack overlaps itself AND values in Technology.
The same problem exists with Office Supplies:
It takes up almost the complete right hand side. So... I think something is wrong in your Dimension 2 calculation.
I've attached my "sandbox" so you can play around in it. I wish I could better resolve your question, but hope this will lead to an answer. You might even try reaching out to Olivier CATHERIN, who is a real guru of Sankey. Good luck!
Creating Charts for Training.twbx 409.4 KB
One other thing I can offer is a relatively simple template for building a sankey. It's meant to be plug-and-play and is based on the work of Olivier Catherin and Jeff Shaffer. Chart Templates Part 1: Sankeys - Ken Flerlage: Analytics Architecture, Strategy, & Visualization