Forum Discussion
Sorting Legend in a Line Chart
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!
- alena2k7 years agoResolver IV
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.- dkinchit7 years agoNew Member
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!
- alena2k7 years agoResolver IV
I hope that something like this will help you:
Last Reported Rank =
RANKX(Categories,
CALCULATE(SUM('Sales'[Sales]), 'Sales'[Date] > EOMONTH(NOW(), -1),'Sales'[Date]<= EOMONTH(NOW(), 0))
,,DESC)I assume that yiy have Caregories table where you can setup sorting by this column.