Forum Discussion

DIACHROMA's avatar
DIACHROMA
Icon for Helper II rankHelper II
2 years ago

Dynamic slicing line chart based on slicers selection

Hello Power BI Community,

 

I'm working on a dashboard where I have a line chart displaying the evolution of conversion rates over time. I'm looking to dynamically segment this line chart based on the selections from three slicers: Client, Supplier, and Product.

 

Here's my specific requirement:

- By default, the chart should always display a curve for each client, based on client slicer.

- If a selection is made in the Supplier slicer, the chart should display all possible Client/Supplier combinations.

- Similarly, if a selection is made in the Product slicer (but not in Supplier), it should show all Client/Product combinations.

- And, if selections are made in both Supplier and Product slicers, it should display curves for all Client/Supplier/Product combinations.

 

I've identified four scenarios based on the selections:

1. No selection in either Supplier or Product slicers: Display a curve per client.

2. Selection in Supplier only: Display a curve for each Client/Supplier combination.

3. Selection in Product only: Display a curve for each Client/Product combination.

4. Selections in both Supplier and Product: Display a curve for each Client/Supplier/Product combination.

 

To achieve this, I tried creating four columns in my table by concatenating values: client / client+supplier / client+product / client+supplier+product. Then, I created a field parameter and added it to the legend field of my line chart. However, I'm struggling to condition the selection of my parameter based on the other slicers' selections.

 

Is it possible to achieve this dynamic segmentation based on slicer selections? If so, how can it be done? If not, is there another approach that could lead me to the desired result?

 

Any guidance or insights from the community would be greatly appreciated!

 

Thank you in advance for your help!

Pauline

2 Replies

  • DIACHROMA I'm having a little hard time understanding the requirement. Although you have well explained it, it is me not able to wrap my head around it. Could you share some sample (dummy) data with the expected result?

    • DIACHROMA's avatar
      DIACHROMA
      Icon for Helper II rankHelper II

      Hi parry2k, thank you for your response.

       

      You can download a sample file at this link: https://we.tl/t-dVdkFgLArS. In this example, I'm working with three slicers: Brand, Class, and Channel.

       

      The goal is to have different views in the line chart based on the user's selections in these slicers. I've created a separate page for each possible view.

       

      Here are the rules:

      1. In the line chart, the default view is to show one line per brand.
      2. If a selection is made only in the Class slicer, the chart should show one line for each Brand/Class combination.
      3. If a selection is made only in the Channel slicer, the chart should display one line for each Brand/Channel combination.
      4. If selections are made in both the Class and Channel slicers, the chart should show one line for each combination of Brand/Class/Channel.