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 / Filter/Sort By Dropdow...
Power Apps
Suggested Answer

Filter/Sort By Dropdown Canvas

(0) ShareShare
ReportReport
Posted on by 91
Hello all, 
 
I've been searching for this solution for an hour and am at a mental gridlock. I need to pull codes from a column in the SharePoint list and filter a gallery by it. I'm currently back to "Incompatible types for comparison. These types can't be compared: Record, Record."
 
Current Code to filter gallery
 
Categories:
  • Suggested answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at
    If 'ORG Code' is a choice or lookup column from SharePoint, then you need to compare the value, since they are represented as records:
    Filter(
      SortByColumns('CSM Tracking', "WeekEnd", SortOrder.Descending),
      'ORG Code'.Value = DropdownCanvas2.Selected.Value)
    Hope this helps!
  • zw2348 Profile Picture
    91 on at
    Thanks for the reply, it didn't like it fully. 
     
     
  • CarlosFigueira Profile Picture
    Microsoft Employee on at
    What is the type of the 'ORG Code' column from the SP list? Is it a choice / lookup column? Does it support multiple selections? Also, what is the Items property of the DropdownCanvas2?
  • zw2348 Profile Picture
    91 on at
    I figured it out, and I appreciate your time and support! 
     
    For the Dropdown I had to use this code: 
     
    Table({Value: "All"}, Distinct('CSM Tracking', 'ORG Code'.Value))
     
    Then for the Gallery Items:
     
    SortByColumns(
        If(Dropdown2.Selected.Value = "All", 'CSM Tracking', Filter('CSM Tracking', 'ORG Code'.Value = Dropdown2.Selected.Value)),
        "WeekEnd",
        If(true, SortOrder.Descending, SortOrder.Ascending)
    )

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard