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 gallery by mult...
Power Apps
Answered

filter gallery by multiselect column without delegation warning

(0) ShareShare
ReportReport
Posted on by 75

Hi,

 

I have a SharePoint list and I am trying to filter a gallery by Department multiselect column. show items where current user department in department multiselect column

how to do that without delegation warning. I tried IN but it is not delegable! .

 

 

Thanks.

Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @Digital_Admin 

     

    Can you also post the code/formula you already have?

  • Digital_Admin Profile Picture
    75 on at

    Filter('Letters', Office365Users.MyProfileV2().department in To.Value)

     

    To is multiselect column 

  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @Digital_Admin 

     

    Instead of "=" use the StartsWith function.

    Filter(
     'Letters', 
     StartsWith(To.Value, Office365Users.MyProfileV2().department)
    )
    

     


    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • Digital_Admin Profile Picture
    75 on at

    this is not a right formula! StartsWith works with text not multichoice column

  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    You need to make text.


    Try this:

    Filter(
     'Letters', 
     StartsWith(Concat(To, Value, ", "), Office365Users.MyProfileV2().department)
    )

     


    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • Digital_Admin Profile Picture
    75 on at

    I tried that but still not delegable

  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Lets use the With() function to avoid delegation.

    In is only delegated for columns on the base data source. 

     

    Please try this:

     

    With(
     {
     _Letters:
     'Letters'
     },
     Filter(
     _Letters,
     Office365Users.MyProfileV2().department in To.Value
     )
     ),

     

     

    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • Digital_Admin Profile Picture
    75 on at

    Hi, That works without delegation. what if I Have multiple filtration. should I put all filtration inside With. and With function should work with large list right. Thanks

     

    Here is my full code, please note that only TO column is multiselect value.

     

     

    SortByColumns(
     Filter(
     'Letters List url',
     And(
     Or(
     And(
     From.Value = varUserDepartment,
     (Status.Value = "In Progress" || Status.Value = "Approved" || Status.Value = "NEW" || Status.Value = "Completed" || Status.Value = "Delivered" || Status.Value = "Rejected")
     ),
     And(
     varUserDepartment in TO.Value,
     (Status.Value = "Completed" || Status.Value = "Delivered")
     ),
     And(
     Status.Value = "Draft",
     'Created By'.Email = varUser.Signer.Email
     )
     ),
     Or(
     IsBlank(Date_From.Value),
     Created >= Date_From.Value
     ),
     Or(
     IsBlank(Date_To.Value),
     Created <= Date_To.Value
     ),
     Or(
     IsBlank(DDDept.Selected.Value),
     From.Value = DDDept.Selected.Value,
     DDDept.Selected.Value in To.Value 
     ),
     Or(
     IsBlank(DD_Status.Selected.Value),
     Status.Value = DD_Status.Selected.Value
     ),
     Or(
     IsBlank(SB_Home_Ref.Text),
     CalRef = Value(SB_Home_Ref.Text)
     ),
     Or(
     IsBlank(SB_Home.Text),
     StartsWith(
     Title,
     SB_Home.Text
     ),
     StartsWith(
     'Subject To',
     SB_Home.Text
     )
     ),
     Or(
     IsBlank(Radio_Filter.Selected.Value),
     Radio_Filter.Selected.Value = "OUT",
     varUserDepartment in To.Value
     ),
     Or(
     IsBlank(Radio_Filter.Selected.Value),
     Radio_Filter.Selected.Value = "IN",
     From.Value = varUserDepartment
     )
     )
     ),
     "ID",
     If(
     SortDescending1,
     SortOrder.Ascending,
     SortOrder.Descending
     )
    )

     

     

  • Verified answer
    SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    @Digital_Admin 

     

    That should also work. 

    Please double check syntax. 

     

    SortByColumns(
    With(
     {
     _Letters_List_Url:
     'Letters List url'
     },
     Filter(
     _Letters_List_Url,
     And(
     Or(
     And(
     From.Value = varUserDepartment,
     (Status.Value = "In Progress" || Status.Value = "Approved" || Status.Value = "NEW" || Status.Value = "Completed" || Status.Value = "Delivered" || Status.Value = "Rejected")
     ),
     And(
     varUserDepartment in TO.Value,
     (Status.Value = "Completed" || Status.Value = "Delivered")
     ),
     And(
     Status.Value = "Draft",
     'Created By'.Email = varUser.Signer.Email
     )
     ),
     Or(
     IsBlank(Date_From.Value),
     Created >= Date_From.Value
     ),
     Or(
     IsBlank(Date_To.Value),
     Created <= Date_To.Value
     ),
     Or(
     IsBlank(DDDept.Selected.Value),
     From.Value = DDDept.Selected.Value,
     DDDept.Selected.Value in To.Value 
     ),
     Or(
     IsBlank(DD_Status.Selected.Value),
     Status.Value = DD_Status.Selected.Value
     ),
     Or(
     IsBlank(SB_Home_Ref.Text),
     CalRef = Value(SB_Home_Ref.Text)
     ),
     Or(
     IsBlank(SB_Home.Text),
     StartsWith(
     Title,
     SB_Home.Text
     ),
     StartsWith(
     'Subject To',
     SB_Home.Text
     )
     ),
     Or(
     IsBlank(Radio_Filter.Selected.Value),
     Radio_Filter.Selected.Value = "OUT",
     varUserDepartment in To.Value
     ),
     Or(
     IsBlank(Radio_Filter.Selected.Value),
     Radio_Filter.Selected.Value = "IN",
     From.Value = varUserDepartment
     )
     )
     ) 
    ),
     "ID",
     If(
     SortDescending1,
     SortOrder.Ascending,
     SortOrder.Descending
     )
    )

     

     

     
    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • Digital_Admin Profile Picture
    75 on at

    Last question to confirm. as my list expected to grow more than 10000 items. the With function should do the job perfectly right., thanks again

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 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard