Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
PowerBITesting
Helper IV
Helper IV

MultiSelect option set D365 Filter with contains query + OR condition

FILTER on multiple tables with contains - Not working 

 

Count= CALCULATE(
COUNT(activity[createdon]),
FILTER(appointments, appointments[Filed1] contains "100") OR
FILTER(CONTAINS(phonecall,phonecall[Filed2],"200")OR
FILTER(CONTAINS(tasks,tasks[Filed3],"200")
)
appointments , phonecall and tasks  all are child of Activity.
and Filed1 ,Filed2 and Filed3 are multioption set D365
 
1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @PowerBITesting ,

 

You could try like this:

Column =
VAR app_id =
    CALCULATE (
        FIRSTNONBLANK ( appointments[ID], 1 ),
        FILTER (
            VALUES ( appointments[Filed1] ),
            SEARCH ( "100", appointments[Filed1],, 999 ) <> 999
        )
    )
VAR pho_id =
    CALCULATE (
        FIRSTNONBLANK ( phonecall[ID], 1 ),
        FILTER (
            VALUES ( phonecall[Filed2] ),
            SEARCH ( "100", phonecall[Filed2],, 999 ) <> 999
        )
    )
VAR task_id =
    CALCULATE (
        FIRSTNONBLANK ( tasks[ID], 1 ),
        FILTER (
            VALUES ( tasks[Filed3] ),
            SEARCH ( "100", tasks[Filed3],, 999 ) <> 999
        )
    )
RETURN
    COUNTROWS (
        FILTER (
            activity,
            activity[app_id] = app_id
                || activity[pho_id] = pho_id
                || activity[task_id] = task_id
        )
    )

v-xuding-msft_0-1597220030730.png

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @PowerBITesting ,

 

You could try like this:

Column =
VAR app_id =
    CALCULATE (
        FIRSTNONBLANK ( appointments[ID], 1 ),
        FILTER (
            VALUES ( appointments[Filed1] ),
            SEARCH ( "100", appointments[Filed1],, 999 ) <> 999
        )
    )
VAR pho_id =
    CALCULATE (
        FIRSTNONBLANK ( phonecall[ID], 1 ),
        FILTER (
            VALUES ( phonecall[Filed2] ),
            SEARCH ( "100", phonecall[Filed2],, 999 ) <> 999
        )
    )
VAR task_id =
    CALCULATE (
        FIRSTNONBLANK ( tasks[ID], 1 ),
        FILTER (
            VALUES ( tasks[Filed3] ),
            SEARCH ( "100", tasks[Filed3],, 999 ) <> 999
        )
    )
RETURN
    COUNTROWS (
        FILTER (
            activity,
            activity[app_id] = app_id
                || activity[pho_id] = pho_id
                || activity[task_id] = task_id
        )
    )

v-xuding-msft_0-1597220030730.png

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@PowerBITesting , Try like

 

Count= CALCULATE(
COUNT(activity[createdon]),
OR(OR(appointments[Filed1] contains "100") , CONTAINS(phonecall[Filed2],"200") , CONTAINS(tasks[Filed3],"200"))
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
lbendlin
Super User
Super User

DAX uses || for the "or" logic and && for the "and" logic.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.