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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

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. 

Data.JPGGraphical Rep.JPG

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
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.

 

2.PNG

 

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]))

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
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.

 

2.PNG

 

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]))

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

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

Anonymous
Not applicable

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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