cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
moelhag
Microsoft
Microsoft

Opposite of "IsMatch" function?

Hello I am trying to filter a dataform connected to a database with a dropdown. I am specifically attempting to filter a column that has multiple values (or tags) separated by a comma. I want to filter this source by multiple conditions, including entities that do NOT contain the word "Global". I cannot do a straight 1 to 1 comparison using "<>" since this column has multiple tags separated by commas. 

 

The function "IsMatch" works when i attempt to only filter to those values in the column. I am curious how i would filter by the inverse of this? Showing ALL results in my dataform for entities that do NOT contain the keyword. The code looks something like this:

 

Dropdown1.Selected.Value = "PM", Filter('Activities', Or(state_label = "Open", stage= "Six"), And(IsMatch(tsatags, "Global", Contains & IgnoreCase)

 

Meaning= When dropdown "PM" is selected, filter data source "Activities" with state = Open, Stage = Six and Tags to all rows that do NOT contain the word "global"

 

Can anybody help me here?

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User III
Super User III

@moelhag
I think you can take this section code that you’ve already written...

 

IsMatch(tsatags, "Global", Contains & IgnoreCase)

 

...and make this simple change.

 

!(IsMatch(tsatags, "Global", Contains & IgnoreCase))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User III
Super User III

@moelhag
I think you can take this section code that you’ve already written...

 

IsMatch(tsatags, "Global", Contains & IgnoreCase)

 

...and make this simple change.

 

!(IsMatch(tsatags, "Global", Contains & IgnoreCase))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

v-yutliu-msft
Community Support
Community Support

Hi @moelhag ,

Do you want to get the inverse value of IsMatch(tsatags, "Global", Contains & IgnoreCase)?

It can be easily implemented by using Not or ! Operator:

Not(IsMatch(tsatags, "Global", Contains & IgnoreCase))

or

!(IsMatch(tsatags, "Global", Contains & IgnoreCase))

Ive made a similar test for your reference:

1\ Add a dropdown control(DropDown1) and Set the controls items property to:

 

 ["PM","PP","MM"]

2\ Add a gallery control and set the controls items property to:

If(

    Dropdown1.Selected.Value = "PM",      

    Filter(

        Activities,

        Or(

            state_label = "Open",

            stage = "Six"

        ) && !(IsMatch(            /*get the inverse value of ‘IsMatch(tsatags, "Global", Contains & IgnoreCase)’*/

            tsatags,

            "Global",

            Contains & IgnoreCase        

        ))

    )

)

   398.png

 

If you still have any question please dont hesitate to let us know.

 

 

Best Regards,

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

@moelhag 

I have no idea why @v-yutliu-msft feels the need to repeat what I have already said 2 days earlier 😒

 

This is the solution...

!(IsMatch(tsatags, "Global", Contains & IgnoreCase))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,956)