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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DonalMc
Advocate II
Advocate II

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

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community 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




Lima - Peru

View solution in original post

3 REPLIES 3
Vvelarde
Community Champion
Community 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




Lima - Peru

Lima Peru - Thank You!

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?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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