Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I have a request to custom sort two charts based on the same table but different columns. I know that I can create sorting order column for one chart but I am not sure how can I do that for a different chart that needs to be sorted on a completely different column. Is it even possible?
Just to clarify, I do not need custom sorting based on two columns, these are two separate charts. I need these custom sort orders because of color coding chart categories but the problem is that these categories originate in two separate columns with different values.
Solved! Go to Solution.
@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
@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
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@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
@Anonymous I'm not sure I understand, what chart/visual are you trying to sort? If it's a table visual you can just click the table heading to sort by that column. If you're trying to sort the same column in a different order on two different visuals, this is not possible. You'll need to create a copy of that column, and change the sort order for it to match the new visual.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
84 | |
83 | |
72 | |
49 |
User | Count |
---|---|
143 | |
130 | |
108 | |
64 | |
55 |