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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sauravtibrewal
Regular Visitor

Need help in creating custom visuals

Hello Friends,

I want to create a dynamic visuals. Example if i am creating a ling graph wrt date and sales and legend product category then i will get multiple lines wrt time for different product. If i select one then rest of the lines should disappear from the visualization.
Any help is appreciated.

2 ACCEPTED SOLUTIONS
FarhanJeelani
Super User
Super User

Hello!

To create a dynamic line chart where selecting one product category hides the other lines, you can use interactions or a single-select slicer in Power BI. Here’s how you can achieve it:

 

 Option 1: Using a Slicer
1. Add a Slicer: Add a slicer visual to your report with Product Category as the field.


2. Enable Single-Select: In the slicer’s format options, turn on Single Select (under Selection Controls). This ensures that when you pick a product category, only that line will show, while others are hidden.


3. Sync with Your Line Chart: Your line chart will now dynamically display only the selected product category.

 

Option 2: Using Visual-Level Filters
1. Create a Visual-Level Filter: On your line chart, go to the Filters pane and add Product Category as a filter.


2. Apply Interaction Controls: If you want to control this interaction from another visual, select the other visual (e.g., a table or chart with Product Categories) and use the Edit Interactions option (found in the Format tab) to make it filter the line chart.

 

Option 3: Bookmark with Buttons (for Complex Scenarios)
If you want to add a bit more interactivity (like toggling between showing all lines or a single one), you can set up bookmarks and buttons to toggle between views. This is a more advanced approach but can give users more control.

Let me know if you’d like more details on any of these!

 

Please mark this as solution if it helps. Appreciate Kudos.

View solution in original post

Poojara_D12
Super User
Super User

Hi @sauravtibrewal 

To achieve this in Power BI, you can use Interactive Filtering by enabling single-select in a slicer. Here's a step-by-step guide to create a dynamic line graph that only displays the selected product category:

  1. Create the Line Graph:

    • In Power BI, create a Line chart and set it up as follows:
      • Drag Date to the X-axis.
      • Drag Sales to the Y-axis.
      • Drag Product Category to the Legend field to generate multiple lines for each product category over time.
  2. Add a Slicer for Product Category:

    • To make the line graph respond to a single product category selection, add a Slicer:
      • Drag Product Category to the slicer field.
    • Format the slicer to single-select mode:
      • Click on the slicer to select it.
      • In the Format Pane on the right, under Selection Controls, enable Single Select.
    • Now, only one product category can be selected at a time, which will dynamically update the line chart to display only that category.
  3. Test the Interactive Filtering:

    • When you select a specific product category in the slicer, the line graph should update to display only that category. All other product categories will disappear from the chart, leaving only the selected line visible.
  4. Optional: Hide the Slicer Header for a Cleaner Look:

    • If you want to make the visual cleaner, you can hide the slicer’s header:
      • Select the slicer, go to the Format Pane > Title, and turn off the title.

Now, when you select a product category in the slicer, only that category's line will display on the chart, making it dynamically responsive based on your selection.

 

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS

View solution in original post

2 REPLIES 2
Poojara_D12
Super User
Super User

Hi @sauravtibrewal 

To achieve this in Power BI, you can use Interactive Filtering by enabling single-select in a slicer. Here's a step-by-step guide to create a dynamic line graph that only displays the selected product category:

  1. Create the Line Graph:

    • In Power BI, create a Line chart and set it up as follows:
      • Drag Date to the X-axis.
      • Drag Sales to the Y-axis.
      • Drag Product Category to the Legend field to generate multiple lines for each product category over time.
  2. Add a Slicer for Product Category:

    • To make the line graph respond to a single product category selection, add a Slicer:
      • Drag Product Category to the slicer field.
    • Format the slicer to single-select mode:
      • Click on the slicer to select it.
      • In the Format Pane on the right, under Selection Controls, enable Single Select.
    • Now, only one product category can be selected at a time, which will dynamically update the line chart to display only that category.
  3. Test the Interactive Filtering:

    • When you select a specific product category in the slicer, the line graph should update to display only that category. All other product categories will disappear from the chart, leaving only the selected line visible.
  4. Optional: Hide the Slicer Header for a Cleaner Look:

    • If you want to make the visual cleaner, you can hide the slicer’s header:
      • Select the slicer, go to the Format Pane > Title, and turn off the title.

Now, when you select a product category in the slicer, only that category's line will display on the chart, making it dynamically responsive based on your selection.

 

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
FarhanJeelani
Super User
Super User

Hello!

To create a dynamic line chart where selecting one product category hides the other lines, you can use interactions or a single-select slicer in Power BI. Here’s how you can achieve it:

 

 Option 1: Using a Slicer
1. Add a Slicer: Add a slicer visual to your report with Product Category as the field.


2. Enable Single-Select: In the slicer’s format options, turn on Single Select (under Selection Controls). This ensures that when you pick a product category, only that line will show, while others are hidden.


3. Sync with Your Line Chart: Your line chart will now dynamically display only the selected product category.

 

Option 2: Using Visual-Level Filters
1. Create a Visual-Level Filter: On your line chart, go to the Filters pane and add Product Category as a filter.


2. Apply Interaction Controls: If you want to control this interaction from another visual, select the other visual (e.g., a table or chart with Product Categories) and use the Edit Interactions option (found in the Format tab) to make it filter the line chart.

 

Option 3: Bookmark with Buttons (for Complex Scenarios)
If you want to add a bit more interactivity (like toggling between showing all lines or a single one), you can set up bookmarks and buttons to toggle between views. This is a more advanced approach but can give users more control.

Let me know if you’d like more details on any of these!

 

Please mark this as solution if it helps. Appreciate Kudos.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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