Forum Discussion
Slicer based on Mesure
- Anonymous2 years ago
Hi dofrancis3 ,
The Table data is shown below:
Please follow these steps:
1.Enter the following data manually.2.Use the following DAX expression to create a measure('sumValue' and 'target' correspond to your ' [%_Pop]' and '[%_Target]' respectively)
Measure = VAR _a = SELECTEDVALUE('Table (2)'[Column1]) RETURN SWITCH(TRUE(), _a = "red",IF([sumValue] <= [target] ,[sumValue],BLANK()), _a = "green",IF([sumValue] > [target] , [sumValue] , BLANK()), [sumValue])3.Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 2 years ago
Anonymous
Your answers are excellent! And I would like to share some additional solutions below.
You can try below solution.
step1. create a calculated table and use to slicer.
ShowType = SELECTCOLUMNS({("Green",1),("Red",2),("Both",3)},"Type",[Value1],"Index",[Value2])step2. create a measure and use to visual filter.
Show Control = IF(NOT ISEMPTY(INTERSECT(VALUES('ShowType'[Type]),{[Bar_chart_Couleur],"Both"})),1,0)The result as follow:
Demo - Slicer based on Mesure.pbix
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
- 2 years ago
Dear Colleagues!
I'd like to thank you for your contribution to my request above.
All your different solutions worked perfectly.
Thank you again.
Hi dofrancis3 ,
The Table data is shown below:
Please follow these steps:
1.Enter the following data manually.
2.Use the following DAX expression to create a measure('sumValue' and 'target' correspond to your ' [%_Pop]' and '[%_Target]' respectively)
Measure =
VAR _a = SELECTEDVALUE('Table (2)'[Column1])
RETURN
SWITCH(TRUE(),
_a = "red",IF([sumValue] <= [target] ,[sumValue],BLANK()),
_a = "green",IF([sumValue] > [target] , [sumValue] , BLANK()),
[sumValue])
3.Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dear Colleagues!
I'd like to thank you for your contribution to my request above.
All your different solutions worked perfectly.
Thank you again.