Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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!

 

  • 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:

    pbix 

     

    Best Regards,

    Giotto Zhi

     

1 Reply

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

    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:

    pbix 

     

    Best Regards,

    Giotto Zhi