Forum Discussion

yforti13's avatar
yforti13
Regular Visitor
1 year ago
Solved

help with legends

Hello everyone!

In the example below I am filtering my graph by the light blue legend, is there any way that when I click on the legend it will only display the visual that I clicked on?

 

  • Hi yforti13 

    • Duplicate your current visual and then disable the legend and the title from the original. 
    • Click the duplicate and go to the general in the formatting pane. Click advanced options and disable Responsive. Resize the duplicate so only the Title and the legend shows.

       

    • Group the two visuals.

     

     

     

  • Thankyou, ryan_mayudanextian, for your response.

    Hi yforti13,

    We appreciate your question on the Microsoft Fabric Community Forum.

    As I understand, the usual behavior in Power BI when you use a legend in a visual (especially with measures) is that clicking on a legend item only highlights that part and makes the others look dim. It does not filter out or hide the other lines. Because you are using measures, you cannot use slicers or filters to change which lines are shown by clicking on the legend.

    To make it work so that you can see only one line at a time, you can use this workaround with Bookmarks, Buttons, and Layered Visuals:

    1. Create separate line charts for each measure (like A, B, and C).
    2. Add three buttons that act like a legend with options "A", "B", and "C".
    3. Make bookmarks that control which chart is shown.
    4. Link the bookmarks to the buttons so that when you click a button, only the chosen line chart is visible.

    This way you get full control over which line is visible and it looks like filtering by clicking on a legend option.

    Please find the attached screenshots and sample pbix file to help you with this:

    If our answer is helpful, please mark it as the accepted solution and give kudos. This will help other members with the same question.

    If you have more questions, please feel free to ask the Microsoft Fabric community.

    Thank you.




8 Replies

    • yforti13's avatar
      yforti13
      Regular Visitor

      but visual fields are measurements.
      You can't use measurements as filters

  • Hi yforti13 

    • Duplicate your current visual and then disable the legend and the title from the original. 
    • Click the duplicate and go to the general in the formatting pane. Click advanced options and disable Responsive. Resize the duplicate so only the Title and the legend shows.

       

    • Group the two visuals.

     

     

     

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Thankyou, ryan_mayudanextian, for your response.

    Hi yforti13,

    We appreciate your question on the Microsoft Fabric Community Forum.

    As I understand, the usual behavior in Power BI when you use a legend in a visual (especially with measures) is that clicking on a legend item only highlights that part and makes the others look dim. It does not filter out or hide the other lines. Because you are using measures, you cannot use slicers or filters to change which lines are shown by clicking on the legend.

    To make it work so that you can see only one line at a time, you can use this workaround with Bookmarks, Buttons, and Layered Visuals:

    1. Create separate line charts for each measure (like A, B, and C).
    2. Add three buttons that act like a legend with options "A", "B", and "C".
    3. Make bookmarks that control which chart is shown.
    4. Link the bookmarks to the buttons so that when you click a button, only the chosen line chart is visible.

    This way you get full control over which line is visible and it looks like filtering by clicking on a legend option.

    Please find the attached screenshots and sample pbix file to help you with this:

    If our answer is helpful, please mark it as the accepted solution and give kudos. This will help other members with the same question.

    If you have more questions, please feel free to ask the Microsoft Fabric community.

    Thank you.




  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Hi yforti13,

    We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

    If you find the response helpful, please mark it as the accepted solution, as this will help other members with similar queries.Should you have any further queries, kindly feel free to contact the Microsoft Fabric community

    Thank you.

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Hi yforti13,

    We wanted to check with you because we have not received any reply. If your problem is solved, please share the solution with the community. This will help others who face the same issue.

    Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.

    Thank you.

     

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Hi yforti13,

    We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

    If our response was helpful, please mark it as the accepted solution, as this helps the broader community.

    Thank you.