Forum Discussion
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?
- Anonymous2 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
- Idrissshatila
Super User
Hello cruzp ,
you can acheive this using field parameters, check it out https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters
subscribe to my channel https://www.youtube.com/@PowerBISolution
- cruzp
Helper 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.
- AnonymousNot 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.