Forum Discussion

cruzp's avatar
cruzp
Icon for Helper V rankHelper V
2 years ago
Solved

Switch Measure with option to Show ALL

Hello PBI folks, 

 

On this graph below:

 

I want to have a slicer that contains 4 selection:

 

  • ALL to show all 3 measure standing next to each other which is already the image above
  • CL will only show CL measure in the graph
  • CW will only show CW measure in the graph
  • R3 will only show R3 measure in the graph

How can i do that in a simple formula?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,

    Thanks for the solution Idrissshatila offered, and i want to offer some more information for user to refer to.

    hello cruzp , you can refer to the following solution.

    Create a type table.

    Then create a new measure

    Measure = SWITCH(SELECTEDVALUE('Type'[Type]),"CL",[CL],"R3",[R3],"CW",[CW])

    Then put the type column to the legend, and the measure to the y-axis, don't change the x-axis.

     

    Output

     

    Then create a  slicer and put the type column to the slicer, then you can filter it, and the chart color will change also.

     

     

     

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

    • cruzp's avatar
      cruzp
      Icon for Helper V rankHelper V

      Is there other way? I used the parameter but I could not change the color of each measure if I am only selecting one measure. But when all is selected, the color is fine cause it shows different to one another.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

    Thanks for the solution Idrissshatila offered, and i want to offer some more information for user to refer to.

    hello cruzp , you can refer to the following solution.

    Create a type table.

    Then create a new measure

    Measure = SWITCH(SELECTEDVALUE('Type'[Type]),"CL",[CL],"R3",[R3],"CW",[CW])

    Then put the type column to the legend, and the measure to the y-axis, don't change the x-axis.

     

    Output

     

    Then create a  slicer and put the type column to the slicer, then you can filter it, and the chart color will change also.

     

     

     

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.