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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
jaryszek
Memorable Member
Memorable Member

How to sort Legend by y-axis within line chart?

Hello,

still looking for a solution how to sort line chart like that:

jaryszek_0-1760539582596.png
So as you can see i can sort by Date Hierarchy which is nice. 

But Legend is sorted alphabetically, not by Y-Axis values (costs). 

But I can not sort by Legend and some kind of measures to be sorted and applied. 
Any magician can help? 

How to write Daxes to achove it?
O maybe there is some other visual which will handle it for me (free one). 

Will be very greatuful!

This is my model:
https://drive.google.com/file/d/14lpEWK-MQ6JMU5_15WVh8Gv22AiGvdpR/view?usp=sharing

Best,
Jacek



 

1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

Hi @jaryszek 
Unfortunately, sorting Legends by Y-axis values is not supported on the default tooltips for the visuals.

You can create a custom tooltip and use it as sorted by y-axis values.

 

I created a Custom tooltip page with Date and Legend and values.

Pragati11_0-1760540933980.png

Sorted the table visual on custom tooltip by Sum of Cos in billing currency.

Added this custom tooltip as a tooltip on the line chart.

When you hove, you see legend values are in descending ouder of y-axis values.

Pragati11_1-1760541034344.png

Just adding a small video to showcase ow it will change with X-axis granularities but still maintain the legend sorting by values.

cw3.gif

 

I am also attaching the PBIX file download link here.

https://we.tl/t-9rthucYZEf

 

Hope this solution helps.

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

4 REPLIES 4
Pragati11
Super User
Super User

Hi @jaryszek 
Unfortunately, sorting Legends by Y-axis values is not supported on the default tooltips for the visuals.

You can create a custom tooltip and use it as sorted by y-axis values.

 

I created a Custom tooltip page with Date and Legend and values.

Pragati11_0-1760540933980.png

Sorted the table visual on custom tooltip by Sum of Cos in billing currency.

Added this custom tooltip as a tooltip on the line chart.

When you hove, you see legend values are in descending ouder of y-axis values.

Pragati11_1-1760541034344.png

Just adding a small video to showcase ow it will change with X-axis granularities but still maintain the legend sorting by values.

cw3.gif

 

I am also attaching the PBIX file download link here.

https://we.tl/t-9rthucYZEf

 

Hope this solution helps.

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

thank you, no possible to add some measure to do this? 

Let me keep this topic open.

Best,
Jacek

Hi @jaryszek,

I would also take a moment to thank @Pragati11 , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

Appreciate if you could share the feedback on our Microsoft Fabric Ideas. Which would be open for the user community to upvote & comment on. This allows our product teams to effectively prioritize your request against our existing feature backlog and gives insight into the potential impact of implementing the suggested feature.


Regards,
Community Support Team.

 

Hi @jaryszek 
I can't think of a way using measures to do this.

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors