Forum Discussion

Rudy123's avatar
Rudy123
Frequent Visitor
1 year ago
Solved

Bar chart with slicer

Dear All, 

I would need to replicate the below charts from Excel in Power BI.

As the number of clients is large, the idea would be to have a single visual with a ticker or slicer to select single Customers or few of them, for instance moving from the representation in chart 1 to that in chart 2. Any suggestion?

ProductCUSTOMER 1CUSTOMER 2ALL 
Product 1112940
Product 212719
Product 3358
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Rudy123 ,

     

    You can refer to the following steps.


    1.Create measure for different customers.

    customer1 =
    SUM('Table'[CUSTOMER 1])
    customer2 =
    SUM('Table'[CUSTOMER 2])

     

    2. Create the field parameters.

     

    3. Place the appropriate fields into the clustered column chart.

     

    The final result is shown below.

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

3 Replies

  • Hi Rudy123 , 
    To replicate these charts in Power BI with a slicer or filter for customer selection, here’s what you could do:

    • Set up the data model: Import your data into Power BI and structure it with fields for Product, Customer, and Value. Ensure that "All" is either included as a separate value in the Customer field or handled with a measure to show total values across all customers.
    • Create a bar chart: Use a clustered bar chart to display the Product and Customer data. Place "Product" on the X-axis and "Value" on the Y-axis. Drag the "Customer" field to the Legend area to differentiate each customer's values by color.
    • Add a slicer: Use a slicer for the "Customer" field. This slicer will allow you to select one or multiple customers, changing the chart dynamically to show only the selected customers’ data, similar to switching from the first chart (multiple customers) to the second (a single customer).
    • Create an “All” measure (if needed): If “All” represents the total value across customers, you can create a DAX measure:

      DAX
      TotalValue = CALCULATE(SUM(Table[Value]), ALL(Table[Customer]))

      Use this measure in the chart to display the “All” bar alongside customer-specific data.
    • Arrange visuals and configure interactivity: Arrange the slicer and bar chart, and enable the slicer to filter the chart directly. This setup will let you select one or multiple customers to view data dynamically without switching between multiple charts.

    If I have resolved your question, please consider marking my post as a solution. Thank you!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Rudy123 ,

     

    You can refer to the following steps.


    1.Create measure for different customers.

    customer1 =
    SUM('Table'[CUSTOMER 1])
    customer2 =
    SUM('Table'[CUSTOMER 2])

     

    2. Create the field parameters.

     

    3. Place the appropriate fields into the clustered column chart.

     

    The final result is shown below.

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.