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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
mnhamermesh
Frequent Visitor

Sort Stacked Area Chart by Measure Values

I'm trying to sort a stacked area chart by the field included in the "Values" field.  I've seen posts where people create sort tables with unique values for each item, but I want the sort order to dynamically change with the summarized values being shown on the chart so when a user makes a slicer selection the legend / stacked chart automatically re-sorts to show the highest summarized value on the top of the legend.

 

 

mnhamermesh_0-1629795617483.png 

 

mnhamermesh_3-1629796318469.png

 

I've tried to sort the Legend field by the column included in the values field, but then run into the 'Sort by another column error'. 

 

mnhamermesh_1-1629796189755.png

 

I've seen others create a new table using the DAX Summarize function which mimics a SQL query with fields + summarizations + group by clause, but trying this method I still couldn't get around the sort by another column error.

 

mnhamermesh_4-1629797019423.png

 

Any help is greatly appreciated!

 

2 REPLIES 2
amitchandak
Super User
Super User

@mnhamermesh , Ideally base column and sort should have one- to - one mapping, that will be best. See like that is not the case, there is two sort value for one value.

 

refer I explained that in the video -  How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi,
Thanks for the response, I watched the video but it doesn't solve for my use case.  I tried to add a rankx column to my table but get an error that I cannot compare text values with number.  I need to sort a text column by the summarized values from a number field dynamicallly so not sure a static rank works in this case. This task is super easy to accomplish in Tabelau, suprised it seems so difficult in PBI.

mnhamermesh_0-1629800279744.png

 

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.