Forum Discussion

sauravtibrewal's avatar
sauravtibrewal
Regular Visitor
1 year ago
Solved

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.

  • 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.

  • 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

2 Replies

  • 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.

  • 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