Abhi
Abhi

Reputation: 351

Custom sorting in PowerBI chart

Recently I came across one issue in which I need to show the column order as per my defined way in PowerBi report. Thing is, PowerBI sorts the columns in either Ascending(A->Z) or descending(Z->A) order, then if one has to apply his custom order how he should achieve this?

Here is and example

Here we can see the order on X-Axis is ascending or we can show it descending, but what if i would like to sort the order with respect to my need; may be as below :

1.2 Wheel Preview --> 1.2 GTR --> 1.2 Ultra --> 1.2 RTR

, Would it be possible in PowerBI desktop while creating the report, if yes, then guidelines to be followed will be well appreciated. :)

Thanks.

Upvotes: 8

Views: 40007

Answers (2)

KARTHIKEYAN.A
KARTHIKEYAN.A

Reputation: 20118

We can able to sort column one depends on another column

My input table

enter image description here

Sorting option config: Select column which you want to sort and select sort button, select based on which column we need to sort

enter image description here

After sorting the table

enter image description here

Upvotes: 0

teylyn
teylyn

Reputation: 35970

Add a column to your source data and populate it with values for the desired sort order. Then select the column you want to custom sort and click Modeling > Sort by Column. Select the new column as the SortBy column for the existing column, like in the screenshot: The SortCategory column is used as the sort order for the Category column.

enter image description here

Now create a chart and the categories on the axis will be sorted according to the values of the SortCategory column.

enter image description here

Upvotes: 11

Related Questions