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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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