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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dobule Filter on Galle...
Power Apps
Answered

Dobule Filter on Gallery (filtering listbox,dropdown fields) giving Cross reference error

(0) ShareShare
ReportReport
Posted on by 216

Hello Powerusers,

In my canvas App I have:

a) Dropdown1 - Orders.'Status'

b) Listbox1 - Orders.'Prefered day'

A Gallery which I want to filter based on Dropdown1 and Listbox1 values I've tried something like this:

 

Filter(Orders,'Prefered day' in ListBox1.SelectedItems.Result And Status in Dropdown1.Selected.'Status ')

 

But keep getting Cross reference error:

Z_Lukowski_0-1612261634706.png

 

Would appreciate any kind of help,

Best Regards

Z.

Categories:
I have the same question (0)
  • v-yangar-msft Profile Picture
    Microsoft Employee on at

    Hi @Z_Lukowski ,

     

    I don't know what's the data source you used in your app.

    I assume that you use the SharePoint List. Here is my structure of my data source as below:

    v-yangar-msft_0-1612335690617.png

    Firstly, i added a drop down list control and list box control.

    Set the items property of drop down to:

    Choices(DateList.Status)

    Set the items property of list box to:

    Distinct(DateList,PreferredDay)

    Then, add a gallery and set the items of it to:

    Filter(DateList, Dropdown1.Selected.Value in Status.Value,ListBox1.Selected.Result = PreferredDay)

     Finally, we can find that when i choose the status 'Delivery' and PreferredDay'1/3/2021', the gallery will filter the records and show as below:

    v-yangar-msft_1-1612335995183.png

     

    Hope it helps!

     

    Thanks,

    Arrow

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Z_Lukowski 

    You could avoid using a choice field altogether by simply hard coding your status items into the dropdown

    ["New","Delivery","Completed","Cancelled"] as these fields are not likely to change.  You can then change the column type in your SharePoint list to single line of text without losing any data.  This will help you avoid some problems that are inherent in Choice type columns. 

  • Verified answer
    NH-05081754-0 Profile Picture
    on at

    Hi! instead of your current formula of:

     

    Filter(Orders,'Prefered day' in ListBox1.SelectedItems.Result And Status in Dropdown1.Selected.'Status ')

     

    remove that "And" in the middle of your logical statement in the filter formula and try one of the following (both should work for you"

     

    Filter(Orders, And('Prefered day' in ListBox1.SelectedItems.Result, Status in Dropdown1.Selected.'Status '))

     

    Or....

     

    Filter(Filter(Orders,'Prefered day' in ListBox1.SelectedItems.Result), Status in Dropdown1.Selected.'Status ')

     

    As a last word of caution, avoid using the "in" logical operator to filter your data (if possible). Tie your ListBox and dropDown items directly to the specific columns in your data, and use the this = that as opposed to this in that. your future self will thank you.

     

    I recently made a video about filtering based on multiple criteria.... perhaps this may be of use to you!

     

    https://youtu.be/0bRR-Zq407c 

     

    Have a great day 🙂

  • Z_Lukowski Profile Picture
    216 on at

    I've found "=" hint in the meantime and of course that fixed the problem also it's easy to miss and refer to Column name in PowerApps instead of Column in the table I was using (my data source was CDS, forgot to mention this). 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard