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! Request now

Reply
SatyamPrajapati
Regular Visitor

Line and Legend highlight in Line chart

Hello,

I have created a line chart in Power BI where:

X-Axis: Month-Year (MMM-YYYY)
Y-Axis: Total_Qty
Legend: Product Name

However, the chart appears complicated due to multiple overlapping lines, making it challenging to distinguish between them. While selecting a line highlights it, the corresponding legend does not highlight, further complicating the interpretation.

To improve usability, I am looking for a solution where, upon selecting a line:

1. All other lines and their corresponding legends are hidden.
2. Only the selected line and its legend remain visible.

I have attached a screenshot for your reference. Kindly provide a solution or guidance to achieve this functionality in Power BI.

SatyamPrajapati_0-1733477965671.png

SatyamPrajapati_1-1733478012195.png

 



6 REPLIES 6
SatyamPrajapati
Regular Visitor

Hello @Tahreem24 ,
Already there are slicer, even after selecteing two slicer there are many lines. thats why i need solution that if i select one linein graph all other line get hide with its legend or i select legend only that line show other lines and legend get hide.
Is this possible?

Tahreem24
Super User
Super User

@SatyamPrajapati One simple workaround is to take slicer and put legend field in it so based on the slicer value that legend value will get highlighted.

Tahreem24_0-1733483237514.pngTahreem24_1-1733483259711.png

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
dharmendars007
Super User
Super User

Hello @SatyamPrajapati , 

You can use DAX to create a measure that returns values only for the selected product and blanks for others

 

Highlighted Total Qty =
IF(
SELECTEDVALUE('YourTable'[Product Name]) = SELECTEDVALUE('Product Name Slicer'[Product Name]),
SUM('YourTable'[Total Qty]), BLANK())

Replace the Total Qty measure in the Y-axis with the Highlighted Total Qty measure.

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

Hello @dharmendars007 ,

what column should I use in place of 'Product Name Slicer'[Product Name] as Dax provided by you?

@SatyamPrajapati 

Machinery name Column, I assume that is what you are using in Visual.

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 




Machinery name column already replaced in left side of equal to, so what should i select right side to equal to? Same as left side?
SELECTEDVALUE('YourTable'[Product Name]) = SELECTEDVALUE('Product Name Slicer'[Product Name])

Machinery column selected in place of Yourtable [Product name], what should I select on right side?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors