Forum Discussion
Bar Chart Sort w/Groups
- 7 years ago
Hello Anonymous
What you need is a numeric column in your data that tells PowerBI how to sort your Tenure column. In my example I added a column to the table based on the Tenure Months.
TenureSort = SWITCH ( TRUE (), Employees[Tenure Months] < 13, 1, Employees[Tenure Months] < 61, 2, Employees[Tenure Months] < 121, 3, Employees[Tenure Months] < 181, 4, 5 )Use the same logic for this column that you used for the Tenure column, just return the number instead.
Then, in the table, select the Tenure column and set the "Sort by Column" to be TenureSort.
That sorting gets applied to the Tenure column in the visual.
Hello Anonymous
What you need is a numeric column in your data that tells PowerBI how to sort your Tenure column. In my example I added a column to the table based on the Tenure Months.
TenureSort =
SWITCH (
TRUE (),
Employees[Tenure Months] < 13, 1,
Employees[Tenure Months] < 61, 2,
Employees[Tenure Months] < 121, 3,
Employees[Tenure Months] < 181, 4,
5
)Use the same logic for this column that you used for the Tenure column, just return the number instead.
Then, in the table, select the Tenure column and set the "Sort by Column" to be TenureSort.
That sorting gets applied to the Tenure column in the visual.
- Anonymous7 years agoNot applicable
Genius! thank you, that worked. :)