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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

xyz

Hi Community,

 

I have a question, I would appretiate your help. 

 

My data seems to be like below:

 

Variable A             Values 

A                            xx

B                            xx

C                            xx

D                            xx

E                             xx

 

where D = A+B+C, E= A+C

 

I have a slicer for "variable A"

Now, I want if someone is cliking on "D" from slicer then user will get a graph (specifically a pie chart) with the combination of A,B,C

Similarly for E, the graph will change with A and C.

 

Is it possible in Power BI desktop?

 

Thanks for the help!

 

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I create a table to test:

1.png

Please take following steps:

1)Create a table by enter data:

2.png

2)Choose column [slicer] as a slicer visual and create a check measure:

Check = SWITCH(true,MAX('Slicer'[Slicer])="A",1,MAX('Slicer'[Slicer])="B",2,MAX('Slicer'[Slicer])="C",3,MAX('Slicer'[Slicer])="D",4,MAX('Slicer'[Slicer])="E",5)

3.png

3)Create a measure to calculate D and E:

Value-Test =

var a = CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Variable A]="A"))

var b = CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Variable A]="B"))

var c = CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Variable A]="C"))

var d = CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Variable A]="A"||'Table'[Variable A]="B"||'Table'[Variable A]="C"))

var e = CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Variable A]="A"||'Table'[Variable A]="C"))

return

SWITCH([Check],1,a,2,b,3,c,4,d,5,e)

4)Choose D or E in slicer to test, and the result shows:

4.png

5.png

Here is my test pbix file:

pbix 

 

Best Regards,

Giotto Zhi

 

View solution in original post

1 REPLY 1
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I create a table to test:

1.png

Please take following steps:

1)Create a table by enter data:

2.png

2)Choose column [slicer] as a slicer visual and create a check measure:

Check = SWITCH(true,MAX('Slicer'[Slicer])="A",1,MAX('Slicer'[Slicer])="B",2,MAX('Slicer'[Slicer])="C",3,MAX('Slicer'[Slicer])="D",4,MAX('Slicer'[Slicer])="E",5)

3.png

3)Create a measure to calculate D and E:

Value-Test =

var a = CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Variable A]="A"))

var b = CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Variable A]="B"))

var c = CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Variable A]="C"))

var d = CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Variable A]="A"||'Table'[Variable A]="B"||'Table'[Variable A]="C"))

var e = CALCULATE(SUM('Table'[Values]),FILTER('Table','Table'[Variable A]="A"||'Table'[Variable A]="C"))

return

SWITCH([Check],1,a,2,b,3,c,4,d,5,e)

4)Choose D or E in slicer to test, and the result shows:

4.png

5.png

Here is my test pbix file:

pbix 

 

Best Regards,

Giotto Zhi

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.