Forum Discussion

unkCandy's avatar
unkCandy
Icon for Helper I rankHelper I
4 years ago
Solved

Slicer with AND condition in Power BI For Many To Many relationship

Hello Community,  I would like for the multiselection in the slicer to get back the AND between the selection instead of OR. I found on the internet many articles on how to do it but the relationshi...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, unkCandy ;

    You could create a flag measure.

    flag = 
    var _count= CALCULATE(DISTINCTCOUNT([Category]),FILTER(ALLEXCEPT('data','data'[Id]),[Category] in ALLSELECTED('Category Filter'[Category])))
    var _count2=CALCULATE(DISTINCTCOUNT('Category Filter'[Category]),REMOVEFILTERS('data'))
    return IF(_count=_count2,1)

    Then apply it into table filter.

    The final output is shown below:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.