cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HarishaAkkil
Helper III
Helper III

Get the records in difference with SharePoint lists in Power Apps

Hi Team,

 

I have two lists - Employee List and Allocation List.

Employee List - All employees will be enrolled here.

Allocation List - Enrolled Employees(look up from Employee list) will be allocated on monthly basis.

Now I need to get the Employees list who are unallocated for the selected month and year. And also, filter the employee records who are all resigned.

 

I have two filter formulas.

The below formula selects the record who are all allocated for the current month.

Allocated Employees for Current Month:

Filter(AllocationList,Year=DropYear_4.Selected.Value && Month=DropMonth_4.Selected.Value)

 The below formula selects the record who are all active (not resigned).

Total Active Employees:

Filter(Employee_1,SystemStatus <> "Pending" && ((Month(DateofExit) >= Value(SelectedMonth)&& Year(DateofExit) = DropYear_4.Selected.Value ) || IsBlank(DateofExit)))

 

Now I have to get the difference of the records: Unallocated Employees = Total Active Employees - Allocated Employees for Current Month.

 

How do I achieve this? Kindly need your help.

If you have any alternate solution please guide me.

 

Thanks,

Harisha

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @HarishaAkkil ,

I have assumed you have the Employee Name or similar in both lists - change EmployeeName to your field names

With(
   {
      wAllocated:
      Filter(
         AllocationList,
         Year = DropYear_4.Selected.Value && 
         Month = DropMonth_4.Selected.Value
      ),
      wActive:
      Filter(
         Employee_1,
         SystemStatus <> "Pending" && 
         (
            (
               Month(DateofExit) >= Value(SelectedMonth) && 
               Year(DateofExit) = DropYear_4.Selected.Value
            ) || 
            IsBlank(DateofExit)
         )
      )
   },
   Filter(
      wActive,
      !(EmployeeName in wAllocated.EmployeeName)
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @HarishaAkkil ,

I have assumed you have the Employee Name or similar in both lists - change EmployeeName to your field names

With(
   {
      wAllocated:
      Filter(
         AllocationList,
         Year = DropYear_4.Selected.Value && 
         Month = DropMonth_4.Selected.Value
      ),
      wActive:
      Filter(
         Employee_1,
         SystemStatus <> "Pending" && 
         (
            (
               Month(DateofExit) >= Value(SelectedMonth) && 
               Year(DateofExit) = DropYear_4.Selected.Value
            ) || 
            IsBlank(DateofExit)
         )
      )
   },
   Filter(
      wActive,
      !(EmployeeName in wAllocated.EmployeeName)
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

HarishaAkkil
Helper III
Helper III

Thank you so much for your help @WarrenBelz. It worked.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,010)