Forum Discussion
ReOrder the Legend in Pie Chart
Below is the Pie Chart I have in my report. I need the legends to be reordered. The reordering should be
1) Completed 2) In Progress 3) Capacity 4) Shortage 5) Others
Legend comes from one column and other quantity comes from other column.
Anonymous , You need create a sort column for that
Status 1 = [status]
Status sort = Switch (true(),
[status] ="Completed",1,
[status] = "In Progress",2,
//add others
)Sort status 1 on the status sort and use that.
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
3 Replies
- amitchandak
Super User
Anonymous , You need create a sort column for that
Status 1 = [status]
Status sort = Switch (true(),
[status] ="Completed",1,
[status] = "In Progress",2,
//add others
)Sort status 1 on the status sort and use that.
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
- P_D_G
Resolver III
Hi amitchandak,
Quick Question: Isn't this solution a bit too resource intensive in case of larger datasets? I've never really tested this before but seems to be more time consuming during data loads/refreshes. Do you have any expereince with this?
Thanks for the answer!
PDG
- P_D_G
Resolver III
Hi Anonymous ,
have alook at this article - it works for any type of chart, not just bar charts.
https://radacad.com/sort-a-column-with-a-custom-order-in-power-bi
Hope it helps,
PDG