Forum Discussion
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.
6 Replies
- dharmendars007
Memorable Member
Hello SatyamPrajapati ,
You can use DAX to create a measure that returns values only for the selected product and blanks for othersHighlighted 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
- SatyamPrajapatiRegular Visitor
Hello dharmendars007 ,
what column should I use in place of 'Product Name Slicer'[Product Name] as Dax provided by you?- dharmendars007
Memorable Member
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
- Tahreem24
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.
- SatyamPrajapatiRegular 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?