Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
Solved! Go to Solution.
Hi,
According to your description, I create a table to test:
Please take following steps:
1)Create a table by enter data:
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)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:
Here is my test pbix file:
Best Regards,
Giotto Zhi
Hi,
According to your description, I create a table to test:
Please take following steps:
1)Create a table by enter data:
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)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:
Here is my test pbix file:
Best Regards,
Giotto Zhi
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |