Forum Discussion
Filter values in table based off slicer using “and” logic rather than “or” logic.
- Anonymous2 years ago
Hi HelpMe ,
You can make a little adjustment on the formula of measure and get the desired result. Please find the details in the attachment.
Flag = var _topics=ALLSELECTED('Topics'[Topics]) var _category=SELECTEDVALUE('Table'[Categories]) var _tab1=CALCULATETABLE(VALUES('Table'[Topics]), FILTER(ALLSELECTED( 'Table'),'Table'[Categories]=_category )) var _tab2=CALCULATETABLE(VALUES('Table'[Topics]), FILTER(ALLSELECTED( 'Table'),'Table'[Categories]=_category&&'Table'[Topics] in _topics)) var _count1=COUNTROWS(_tab2) var _count2=COUNTROWS(_topics) return IF(_count1 =_count2&&COUNTROWS(_tab1)=COUNTROWS(_tab2),1,0)Best Regards
Hi HelpMe ,
You can make a little adjustment on the formula of measure and get the desired result. Please find the details in the attachment.
Flag =
var _topics=ALLSELECTED('Topics'[Topics])
var _category=SELECTEDVALUE('Table'[Categories])
var _tab1=CALCULATETABLE(VALUES('Table'[Topics]), FILTER(ALLSELECTED( 'Table'),'Table'[Categories]=_category ))
var _tab2=CALCULATETABLE(VALUES('Table'[Topics]), FILTER(ALLSELECTED( 'Table'),'Table'[Categories]=_category&&'Table'[Topics] in _topics))
var _count1=COUNTROWS(_tab2)
var _count2=COUNTROWS(_topics)
return IF(_count1 =_count2&&COUNTROWS(_tab1)=COUNTROWS(_tab2),1,0)
Best Regards
Hi thank you that did work. I have one more question, to add some more complexity to it. What if there were duplicates? Say category A had t01 multiple times and category B had t02 multiple times? In my testing it does not work in that case how would you adapt the logic for this use case? Appreciate all the help!
- Anonymous2 years agoNot applicable
Hi HelpMe ,
It should be also work even though there are duplicated values. Could you please provide your sample pbix file to explain your problem? Thank you.
How to upload PBI in Community
Best Regards