Forum Discussion

ogend's avatar
ogend
Helper II
3 years ago

Sorting in the Bar Chart

Hello guys, 

 

I have a simple bar chart - it slices the data  by a numeric variable on Y- axis , categorical on X- axis and period (year) further slices under the legend

 

I need to sort the chart  by the value of the most recent year, from 1 to 2 per picture below 

 

I could not figure out how to do that using the bar chart, and ended up setting up measures where the most current year  in the data (Max[CurrentYEar])  is Current Year, the Prior Year = Current Year -1 etc. Now I can sort the visual by Current Year value, but my problem is that i don't know if it's possible to dynamicaly label the years. Right now I am picking up measures CY, CY-1, etc. and manually use "rename for this visual" feature to change the years. This is a published report that pulls from a database, if I don't catch the day the new year data becames availalble, the users are misguided. 

Would you know if there is a way to achieve what I am looking for - to sort by the value of the most recent year, and have dynamic lableing so I don't have to worry about renaming through "rename for this visual"? 

 

Thank you!

1 Reply

  • Hi,

    I am not sure how much i can help but i would like to try.  Share the download link of the PBI file