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 Current Supervisor
Power Apps
Unanswered

Filter Current Supervisor

(0) ShareShare
ReportReport
Posted on by 102

Hi Everyone;

I need to ClearCollect a Filter the most updated Supervisor for each Location, so it could be displayed with all its data on a ComboBox. Now gonna expand:

 

I had an app for my Supervisors where they can create records on a Sharepoint List ONLY for locations where they are assigned currently assigned.

 

For this, I'm using two Sharepoint Lists:

Sharepoint List 1 "Listado_Localidades": With currently 210 records and low growing, and where are every single location that is available and active):

IDNombre_de_la_LocalidadActive
1Contoso HQYes
2Contoso West CoastNo
3Contoso East CoastYes
4Adventure WorksYes

 

And

Sharepoint List 2 "LocalidadesSupervisadas": With almost 700 records and growing like 100 per year. Where it's a record of every single Supervisor that had supervised every single location:

IDID_LocalidadNombre_de_la_LocalidadSupervisor_Correo
11Contoso HQtim@consoto.com
21Contoso HQbob@contoso.com
32Contoso West Coasttim@consoto.com
43Contoso East Coasttim@consoto.com
54Adventure Works HQbob@contoso.com
64Adventure Works HQtim@consoto.com

 

Currently, the formula used was provided by "v-bofeng-msft " through this previous post, which worked great at the beginning :

 

 

Filter(
 Locations,
 ID in Search(ForAll(Distinct(Supervisor,Location_ID),Last(Sort(Filter(Supervisor,Result=Location_ID),ID,Ascending))),CurrentUser.Mail, "Supervisor_Email").Location_ID 
).Name

 

 

 

But I'm having performance issues where it can take up to 40 seconds to load, both after Published on endpoints and even in testing.

 

Could provide any help on optimizing this?

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @OSBSoto :

    Please check if this formula helps:

    Filter(
     Locations,
     ID in Search(
     AddColumns(
     GroupBy(
     Supervisor,
     "Location_ID",
     "NewGroup"
     ),
     "Supervisor_Email",
     Last(NewGroup).Supervisor_Email
     ),
     CurrentUser.Mail,
     "Supervisor_Email"
     ).Location_ID
    ).Name

    Best Regards,

    Bof

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @OSBSoto :

    Has this problem been solved?
    If my answer helps , please consider marking it as a 'Solution' to help others. 

    Best Regards,

    Bof

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard