Forum Discussion
Need help! How to create a filter based on groups with the same values
- Anonymous3 years ago
Hi nikitak224 ,
I created some data:
Here are the steps you can follow:
1. Enter data – Create a table.
2. Create measure.
Flag = var _select=SELECTCOLUMNS('Table',"1",[State]) VAR _SELECT1=SELECTEDVALUE('Table2'[Group]) return SWITCH( TRUE(), AND(_SELECT1="Group1" , "NJ" in _select || "CT" in _select || "TX" in _select || "AR" in _select ||"CA" IN _select ),1, _SELECT1="Group2" ,1, AND(_SELECT1= "Group3" , NOT("NJ") IN _select),1, AND(_SELECT1="Group4" , "NJ" IN _select),1,0 )3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Select the corresponding Slicer to display the corresponding rules
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi nikitak224 ,
I created some data:
Here are the steps you can follow:
1. Enter data – Create a table.
2. Create measure.
Flag =
var _select=SELECTCOLUMNS('Table',"1",[State])
VAR _SELECT1=SELECTEDVALUE('Table2'[Group])
return
SWITCH(
TRUE(),
AND(_SELECT1="Group1" , "NJ" in _select || "CT" in _select || "TX" in _select || "AR" in _select ||"CA" IN _select ),1,
_SELECT1="Group2" ,1,
AND(_SELECT1= "Group3" , NOT("NJ") IN _select),1,
AND(_SELECT1="Group4" , "NJ" IN _select),1,0
)
3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Select the corresponding Slicer to display the corresponding rules
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly