Problem: I cannot sort the legends based on the chosen category's sales proportion, PBI does it based on alphabetical order. Strange given you would have expected this to occur by default like excel. The idea is that whatever category/legend is selected (segment, brand or nameplate etc.), it is able to sort itself in descending order of % sales.
a) If I try to sort by clicking on the menu on the top right hand corner, and selecting 'Sort by % Sales', then it sorts the months on the X-Axis instead.
b) If I use Visual Level Filters, go to Sales, select 'Top N' and select Top 5, while it does hide the remaining Segments, it also recalculates the '% Sales' which gives the incorrect proportions.
How do I sort the legend by value AND show only a select set of things (e.g. maybe Top 5 Segments, but then it could be a chart that has select set of key brands etc.)?
Measure: % Sales = [Monthly Total]/CALCULATE([Monthly Total],ALLSELECTED())
So, you need to create a numeric column that has them in the desired numeric order and then change the Sort By column of your alphanumeric column to that new numeric column.
@Greg_Deckler - tks a lot for the quick reply. Actually I've been tracking this for many days and have seen replies on this, some of them from you too 🙂
The problem I face is, I want to do this dynamically. The sales data gets updated monthly. So the next month if any of this ordering was to change, how do I build that column to account for that? Lastly, in this chart it's car segments (e.g. Compact Car, Compact SUV etc.). If I am making the same chart for say brands (Chevy, Ford, Honda etc.) is there a way that the 'numeric column' you mentioned, can account for it?
Or what would you suggest as a turnaround?
Tks again for your time!
If you are looking for the last reported month ranking, you could add calculated column which would use data using filter of last month from today's month.
It should work for your categorical filters as well. It will not work for date filters if you need them.
@alena2k - Tks! As you can guess I am still a newbie so would appreciate if you could post a sample formula of sorts of how I would define that new column?
Appreciate your time!
I hope that something like this will help you:
Last Reported Rank =
CALCULATE(SUM('Sales'[Sales]), 'Sales'[Date] > EOMONTH(NOW(), -1),'Sales'[Date]<= EOMONTH(NOW(), 0))
I assume that yiy have Caregories table where you can setup sorting by this column.
Any luck with the solution provided? I have been trying to solve (almost ) the exact same problem for last couple of weeks and can't seem to hit it right. I try sorting by column but it gaveme an error
We're excited to announce our first cross-community 'Can You Solve These?' challenge!
Visit our Community Blog for articles, guides, and information created by fellow community members.
Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.