The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Dear Colleagues, Please i need your suport ! I would like to create a Slicer which can allow me to display “only Green chart” or “only Red chart” or two of them "red and Green). Below is my conditional mesure and the result of my bar chart: Bar_chart_Couleur = IF( [%_Pop] > [%_Target], "Green", "Red")
Solved! Go to Solution.
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.
@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~
Dear Colleagues!
I'd like to thank you for your contribution to my request above.
All your different solutions worked perfectly.
Thank you again.
@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~
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.
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
32 | |
14 | |
10 | |
10 | |
9 |