Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Make Clustered Chart with Two Slicer

Hi,
I am trying to make a clustered bar chart in Power BI.

The situation is described as below : 

I have a column "Value" which stores numeric value and I created another duplicate of this column (value duplicate). Same I have done for slicer and duplicated it.

The requirement is that in a clustered bar chart, I want one bar A should respond to slicer A and bar B to slicer B.
So that I can compare two bars (values, duplicate value ) one in "New" and other in "old" for same Place(axis) )

The output I am getting: - 

 

If the value selected in both slicers is same then only I am getting value. If I select New in slicer A and Old in Slicer B then clustered bar chart becomes blank. (for obvious reasons as both slicers have interaction activated with clustered bar chart) (Interaction between the slicer is disabled)


I have tried making all possible calculated columns and measure.
And came to conclusions that it is not doable in power bi (might be I am wrong).

I have tried duplicating the data source as well and using one slicer from each data source, still didn't get the desired output.

Currently, 
I can make two different horizontal graphs instead of creating one clustered bar chart.

Kindly help me or guide me in some direction. 

  • Hi Anonymous ,

     

    Please check the following steps as below.

     

    1. Create calculated tables as below.

    D S = VALUES(Table1[Slicer Duplicate])
    S A = VALUES(Table1[Slicer A])

     

    2. Create relatioship between tables.

     

     

    3. After that, we can create two measures to achieve our goal.

     

    Measure = CALCULATE(SUM(Table1[value]),USERELATIONSHIP('S A'[Slicer A],Table1[Slicer A]))
    Measure 2 = CALCULATE(SUM(Table1[value]),USERELATIONSHIP('D S'[Slicer Duplicate],Table1[Slicer Duplicate]))

     

3 Replies

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

    Hi Anonymous ,

     

    Please check the following steps as below.

     

    1. Create calculated tables as below.

    D S = VALUES(Table1[Slicer Duplicate])
    S A = VALUES(Table1[Slicer A])

     

    2. Create relatioship between tables.

     

     

    3. After that, we can create two measures to achieve our goal.

     

    Measure = CALCULATE(SUM(Table1[value]),USERELATIONSHIP('S A'[Slicer A],Table1[Slicer A]))
    Measure 2 = CALCULATE(SUM(Table1[value]),USERELATIONSHIP('D S'[Slicer Duplicate],Table1[Slicer Duplicate]))

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank You v-frfei-msft  for the swift and accurate solution. 
      Well, I learned something new today thanks to you. 

    • Ragasri's avatar
      Ragasri
      New Member

      Hi,

      I tried the same solution but i'm facing circular dependency error while making a relationship with the tables created. I'm new to powerbi and need help