web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Inverse Filter Gallery...
Power Apps
Unanswered

Inverse Filter Gallery by another gallery

(0) ShareShare
ReportReport
Posted on by 89

Hi @ all

 

I hope you can help me again. 
As in this post: (2) Solved: Filter Gallery by another gallery - Power Platform Community (microsoft.com)
My filter I working now correctly. But I have another 2 Tables where I want to to the same but inverted.

So Gallery1 is not showing all the ProductID that are listed in Gallery2. 
My formula in the Items field from Gallery1 is 
Filter(Products, Not('Product Number' in Gallery_FilterAttributes.AllItems.PRODUCTNUMBER))
This gives me this error 
"not operator along with the custom named condition operators is not allowed"

Another question is where to put the "Not" operator. The other option is to filter Gallery2 so Gallery2 shows only the entries
that are not filtered out.
The formula for the Items field in Gallery2 is
Filter(PRODUCT_ATTRIBUTE_VALUE_NEWS, ATTRIBUTENAME in CB_FilterAttributes.SelectedItems.Value)

Products = Datasource1 
PRODUCT_ATTRIBUTE_VALUE_NEWS = Datasource2
CB_FilterAttributes = Combobox with hard coded values

'Product Number' = Column in Datasource1

ATTRIBUTENAME = Column in Datasource2

Gallery_FilterAttributes = Gallery2


Best regards

Kayron

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Kayron1212 ,

     

    To invert the filter applied to Gallery2, place the Not operator here:

     

    Filter(PRODUCT_ATTRIBUTE_VALUE_NEWS, Not(ATTRIBUTENAME in CB_FilterAttributes.SelectedItems.Value))
  • Kayron1212 Profile Picture
    89 on at

    Hi,

    when I use this formula i get the same error as for Gallery1
    "not operator along with the custom named condition operators is not allowed"
    Strangely the error pops up after I click on an element in my combobox.

     

    Edit:
    Exact error message:

    An error occurred on the server. Server Response: PRODUCT_ATTRIBUTE_VALUE_NEWS failed: not operator along with the custom named condition operators is not allowed


    Best regards
    Kayron

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Kayron1212 ,

     

    Just to be sure, what control/property are you trying to set? Is it the Items property for Gallery1? 

     

    In my test I didn't have any issue:

    BCBuizer_0-1671723942630.png

     

    Can you please share a screenshot of how things are set up and what you are trying to set?

     

  • Kayron1212 Profile Picture
    89 on at

    Hi BCBuizer,

     

    these are the gallerys. Left one is the table that is the one that the user sees (Gallery1).
    The middle one is the table where the filter needs to be inverted. As you can see 4 products are shown but I want everything else shown except for the chosen ones in the combobox below Gallery2.
    The right gallery is an "not inverted" Filter.
    Use case is I want products in gallery1 to be shown according to the filter set in the comboboxes.
    Problem is that things like "Vegan" must include the products in Gallery1 and things like "contains nuts" should be subtracted from Gallery1.

    To the question: I tried to put the "Not()" formula in Gallery1 and Gallery2. I get the same error message as mentioned before.

     

    Gallery1: Items:
    Filter(Products, 'Product Number' in Gallery_FilterAttributes.AllItems.PRODUCTNUMBER)

    See 2nd Screenshot. There is the error shown.

     

    Gallery2: Items:
    Filter(
    Filter(PRODUCT_ATTRIBUTE_VALUE_NEWS, 'ATTRIBUTENAME' in CB_FilterAttributes.SelectedItems.Value,BOOLEANVALUE),
    'PRODUCTNUMBER' in Gallery_FilterAttributes_1.AllItems.PRODUCTNUMBER)

    Gallery3: Items:
    Filter(
    PRODUCT_ATTRIBUTE_VALUE_NEWS, 'ATTRIBUTENAME' in CB_FilterAttributes_1.SelectedItems.Value,
    BOOLEANVALUE)

     

    Best regards

    Kayron

    Kayron1212_0-1671731323357.png

    Kayron1212_1-1671732342763.png

     

     

     

  • Kayron1212 Profile Picture
    89 on at

    Hi again,

    if I put you formula in the Items for Gallery2 there are no items shown at all.

    Kayron1212_0-1671732815187.png

    Kayron1212_1-1671732868703.png

     

     

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Kayron1212 ,

     

    What data source are you using? 

     

    I continue to not have issues, even when introducing a combo box (the Items property for the RightGallery remained unchanged since my previous screenshot):

     

    BCBuizer_0-1671733981716.png

     

  • Kayron1212 Profile Picture
    89 on at

    Both of the Datasources are Microsoft Datavers ones.

     

    Best regards

    Kayron

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Kayron1212 ,

     

    In my tests so far I was using SharePoint lists without issues. As soon as I switched to Dataverse tables, I got the same error:

    BCBuizer_0-1671745833674.png

     

    The only way I got this to work is by adding a second combo box (ComboBox4_1) with the same Items property, but setting the DefaultSelectedItems property to:

     

    Filter(Choices(Contacts.'Preferred Method of Contact'),Not(Value in ComboBox4.SelectedItems))

     

    Basically this combobox will have the inverted selection of the first combobox. For some reason this does not cause errors and can then be used to filter the gallery where you want the inverted selection:

    BCBuizer_1-1671746162628.png

    After all is working, you can just hide the second the second combobox and all is working as you want it.

  • Kayron1212 Profile Picture
    89 on at

    Hi BCBuizer,

    I tried:

    Filter(Choices(PRODUCT_ATTRIBUTE_VALUE_NEWS.'PRODUCTNUMBER'), Not(Value in CB_FilterAttributes.SelectedItems))

    This gives me the error that Choices has some invalid arguments. PRODUCTNUMBER is an Text datatype.

    Kayron1212_0-1671790940535.png

    And the 2nd error I get is that "Value" isn't recognized.

     

    Best regards

    Kayron 

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Kayron1212 ,

     

    Indeed the code is not working since it is meant to be applied to Choices type columns and PRODUCTNUMBER is a text type.

     

    I tried a similar workaround for Text type columns and unfortunately it does not work there because I get the same server error. This means it can be applied directly to galleries 2 and 3 only. 

     

    However, the good news is that you can use the combo boxes instead of the galleries to filter Gallery1.

     

    Looking at the mock-up below, you'll have a total of 3 combo boxes (A, !A and B):

    BCBuizer_0-1671807518136.png

     

    ComboBox A is used to filter Gallery2, but because of the abovementioned, the hidden ComboBox !A is needed which has the inverted selection of ComboBox A. The Items property of Gallery should look like:

    Filter(PRODUCT_ATTRIBUTE_VALUE_NEWS, ATTRIBUTENAME in CB_!A.SelectedItems.Value)
    Filter(PRODUCT_ATTRIBUTE_VALUE_NEWS, ATTRIBUTENAME in CB_!A.SelectedItems.Value)

     

    ComboBox B is used to filter Gallery3. Since the requirement is to have the selection of the ComboBox included, nothing has to change there.

     

    Both ComboBox !A and B can now be used to filter Gallery1 by setting its' Items property to:

    Filter(
     Products,
     'Product Number' in Filter(
     PRODUCT_ATTRIBUTE_VALUE_NEWS, 
     ATTRIBUTENAME in CB_!A.SelectedItems.Value ||
     ATTRIBUTENAME in CB_B.SelectedItems.Value)
     ).PRODUCTNUMBER
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard