Forum Discussion

Th0mc's avatar
Th0mc
Frequent Visitor
3 years ago
Solved

Need to dynamically filter on two columns adding the filter (OR operator)

Hi all,   Seems that my DAX knowledge is not sufficient. Here are the needs : - I want to filter a table depending on a visual slicer - The value selected in this slicer combines a list of value...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Th0mc ,

     

    Please try:

    Filter on Domain+Entity = 
    VAR _domain_group =
        SELECTEDVALUE ( 'Domain Groups'[Domain Group] )
    VAR _subdomain_code =
        CALCULATETABLE (
            VALUES ( 'Domain Groups'[SubDomain Code] ),
            'Domain Groups'[Domain Group] = _domain_group
        )
    VAR _entity3 =
        CALCULATETABLE (
            VALUES ( 'Domain Groups'[Entity 3] ),
            'Domain Groups'[Domain Group] = _domain_group
        )
    VAR _filter =
        IF (
            MAX ( 'Projects'[SubDomain Code] )
                IN _subdomain_code
                    || MAX ( 'Projects'[Entity 3] ) IN _entity3,
            1
        )
    RETURN
        _filter

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data