Forum Discussion

DonalMc's avatar
DonalMc
Icon for Advocate II rankAdvocate II
9 years ago
Solved

CALCULATETABLE Filter with &&& and ||

Hi,

 

I am trying to create a filter table with the below expression; however, I can't seem to use the highlighted || or element with the && and elements.

 

When I remove it, it returns a much smaller subset, when I leave it in it breaks the other filters.

Is ths a syntax issue of some kind?

 

2_Leads_Awareness = CALCULATETABLE('2_Leads', FILTER('2_Leads', '2_Leads'[Lead Status] <> "Disqualified" && '2_Leads'[Source Campaign Buyer's Journey] = "Awareness" && '2_Leads'[Lead Type] = "MQL" || '2_Leads'[Lead Type] = "Non-MQL"))

 

Thanks,

Donal

  • Hi DonalMc

     

    Try this:

     

    2_Leads_Awareness =
    CALCULATETABLE (
        '2_Leads',
        FILTER (
            '2_Leads',
            '2_Leads'[Lead Status] <> "Disqualified"
                && '2_Leads'[Source Campaign Buyer's Journey] = "Awareness"
                && '2_Leads'[Lead Type] IN { "MQL","Non-MQL"}
        )
    )

    Regards

     

    Victor

    Lima Peru

3 Replies

  • Vvelarde's avatar
    Vvelarde
    Icon for Community Champion rankCommunity Champion

    Hi DonalMc

     

    Try this:

     

    2_Leads_Awareness =
    CALCULATETABLE (
        '2_Leads',
        FILTER (
            '2_Leads',
            '2_Leads'[Lead Status] <> "Disqualified"
                && '2_Leads'[Source Campaign Buyer's Journey] = "Awareness"
                && '2_Leads'[Lead Type] IN { "MQL","Non-MQL"}
        )
    )

    Regards

     

    Victor

    Lima Peru

  • Anonymous's avatar
    Anonymous
    Not applicable

    I actually haven't used && and || at the same time so I'm not sure, but have you tried using brackets to better define your logic?