Forum Discussion
Custom sort order in two charts
- 5 years ago
Anonymous , you can not sort same column on two different method
Column 1Sorted on Sort1
then if you need to sort on sort 2, then try
Column 2 = [column 1]
now sort column 2 on sort 2 and use column 2 in the visual https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
- 5 years ago
Anonymous In Power Query, add new Conditional Column to the table in your screenshot:
If Priority equals Low then 1
add condition
If Priority equals Medium then 2
add condition
If Priority equals High then 3
else 4
Name this column [PrioritySort]
Then repeat with a new conditional column for [Time Left Sort]
And then you can use the 'Sort by Column' functionality to sort Priority by [PrioritySort] and Time Left by [TimeLeftSort] .
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column
Hi Allison,
I am trying to sort stacked column charts based on this logic
One stacked column chart shows priority values and the second chart shows time left. If I create custom sort order column for priority column to display colors in certain way (dark green, yellow, red in that order) then my time left chart is not going to be sorted in the same way and vice versa. I basically need both stacked charts to show categories in this order (dark green, yellow, red).
Hopefully this makes it somewhat clearer.
Anonymous In Power Query, add new Conditional Column to the table in your screenshot:
If Priority equals Low then 1
add condition
If Priority equals Medium then 2
add condition
If Priority equals High then 3
else 4
Name this column [PrioritySort]
Then repeat with a new conditional column for [Time Left Sort]
And then you can use the 'Sort by Column' functionality to sort Priority by [PrioritySort] and Time Left by [TimeLeftSort] .
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column