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 / Best way to filter a f...
Power Apps
Unanswered

Best way to filter a field?

(0) ShareShare
ReportReport
Posted on by 2

I have a SharePoint list of minors that has 2 fields in it, Minor and Department, and the Minor field feeds into a "master" SharePoint list as a lookup column.  All but 4 of the minors needs to be available to all departments.  4 of the minors needs to be tied to the department drop-down that if a particular department is selected.  

 

NOTE:  The Major and Concentration fields in the Power Apps snippet are from a different SharePoint List and feeds into the "master" SharePoint list as a lookup column.  The attached images shows a snippet of the SP list of minors and a snippet of how the Power App is laid out for that section.

 

What's the best way to filter this to where the majority of the minors are available no matter what department is selected and when a particular department is selected, the four minors assigned to that department is available?  Thanks!

Screenshot 2024-04-24 114532.png
Screenshot 2024-04-24 115225.png
Categories:
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    HI @smblair,

    I think you should provide more details about the relationships between miors and department, not very clear relationship in your first screenshot.

     

    I assume that you want to filter minor based on department selected, you need to set the Items property of the minor datacardvalue as:

    Filter(Choices(Masterlist.Minor),Value in Filter(list_minors,Department=DataCardValue_Depart.Selected.Value).Minor)
  • smblair Profile Picture
    2 on at

    @v-qiaqi-msft - I tried your suggested formula and it didn't work.  To answer your question, seven of the departments have multiple minors with the last department only having 4 minors, that are not available for the other seven departments.

     

    I reworked the list to where each minor is in the list seven times, one for each department (see screenshot).

     

    I have tried the following functions with no luck:

    Filter('SPList', Department = DataCardValue.Selected.Value) and Distinct(Filter('SPList', Department = DataCardValue.Selected.Value), MinorColumn)- incompatible types for comparison (table, text)

    Filter('SPList', Department = DataCardValue.Selected) and Distinct(Filter('SPList', Department = DataCardValue.Selected.Value), MinorColumn)- selected isn't recognized

    Filter('SPList', Department = DataCardValue) and Distinct(Filter('SPList', Department = DataCardValue.Selected.Value), MinorColumn) - incompatible types for comparison (table, text)

     

    Is there a better way to do the SP List, other than having most of the minors in the list seven times?

     

    Screenshot 2024-04-26 144937.png

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 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard