Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ogend
Helper I
Helper I

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 

 

ogend_0-1678575849848.png

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 1
Ashish_Mathur
Super User
Super User

Hi,

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.