How to define an sorting order for a given column based on another column

Suppose you have Sales data by countries. It has 3 columns, Country column for country names, Sales for the total sales amounts, and Quantity for total order quantities.

The Country column is currently ordered by the Sales values. So if you go to the chart view and assign Country to X Axis, Sales to Y Axis, it shows like this.

Now, we want to define the sort order of the countries by Quantity values. Here is how.

Click the column header menu of the Country column, choose Set Order for Values and choose By Another Column.

It opens up a dialog. Choose Quantity and hit Run button.

That’s it!

Let’s go back to the bar chart. Now the country sort order is changed based on Quantity.

If the chart is not sorted as expected, make sure the pin is pointing to the step that we created above. You can change the pinned step by drag-and-drop the pin icon to the step.