Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello everyone, I have the followin stacket column chart, and I woukd like to sort the the percent values and is not working by the ordinary way. I only have the option below., and if the I choose market share asc or desc nothing happens, there's a way to put the the the larger number at the end and grow the stacked till the lowest? In the image is working cause a I put some space/tab into the name of legend.
The measure is
Solved! Go to Solution.
I don't know an easier way other than what you've tried to do with the legend.
You can however, do the same thing without it visibly affecting the legend.
I do something similar to control complex table sorting requirements with this...
SortUnderHours =
//UNICHAR(8203) is a zero width space REPT() repeats a character x many times.
//More spaces sort at the top when in DESC order.
VAR __HR = [HoursRemaining]
VAR __DCE = [DaysToCycleEnd]
VAR __HRCD = [HoursRemaining_CycleDays]
VAR _c = 8203
RETURN
SWITCH
(TRUE()
, __HR <= 0, BLANK()
, AND(__DCE = 0, __HR > 0), REPT( UNICHAR(_c) , 3)
, __HRCD > 12, REPT( UNICHAR(_c) , 5)
, __HRCD >= 8, REPT( UNICHAR(_c) , 4)
, __HRCD < 8, REPT( UNICHAR(_c) , 2)
, BLANK()
)
You could adapt this for your legend potentially to control the sorting. It'll take some work which I don't have time for right now but hopefully it'll get you started.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
Hi, Can u please explain in detail how it got resolved.
Hi @Anonymous ,
It is not supported to sort a stacked column chart by value in Power BI currently .There is an idea about this issue, please vote it up, Stacked bar chart total sort , to improve the Power BI.
I have also found a similar post, please refer to it to see if it helps you.
Stacked column chart: Sort legend by value, not alphabet
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I don't know an easier way other than what you've tried to do with the legend.
You can however, do the same thing without it visibly affecting the legend.
I do something similar to control complex table sorting requirements with this...
SortUnderHours =
//UNICHAR(8203) is a zero width space REPT() repeats a character x many times.
//More spaces sort at the top when in DESC order.
VAR __HR = [HoursRemaining]
VAR __DCE = [DaysToCycleEnd]
VAR __HRCD = [HoursRemaining_CycleDays]
VAR _c = 8203
RETURN
SWITCH
(TRUE()
, __HR <= 0, BLANK()
, AND(__DCE = 0, __HR > 0), REPT( UNICHAR(_c) , 3)
, __HRCD > 12, REPT( UNICHAR(_c) , 5)
, __HRCD >= 8, REPT( UNICHAR(_c) , 4)
, __HRCD < 8, REPT( UNICHAR(_c) , 2)
, BLANK()
)
You could adapt this for your legend potentially to control the sorting. It'll take some work which I don't have time for right now but hopefully it'll get you started.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
79 | |
53 | |
39 | |
36 |
User | Count |
---|---|
100 | |
85 | |
47 | |
46 | |
44 |