Hello Power Apps Community,
I need some guidance to do gallery filtering using a value on a Label text that comes from LookUp function from another table.
Here is my scenario :
1. Lets say i have three table on SQL server
1st : Company
| Id | CompanyName |
| 1 | Company_A |
| 2 | Company_B |
2nd : Department
| Id | Department | Company_Id (Foreign Key) |
| 1 | Technician | 2 |
| 2 | Sales | 1 |
| 3 | Administration | 2 |
3rd : Person
| Id | Name | Department_Id (Foreign Key) |
| 1 | Roy | 1 |
| 2 | John | 2 |
| 3 | Amber | 2 |
| 4 | Frank | 3 |
2. I make gallery in Powerapps to show the Person table
And then i put Label1 inside the gallery to LookUp the value from Department to get the Company_Id
LookUp(Department, Id = ThisItem.Id, Company_Id)
Then i put Label2 inside the gallery to LookUp the value from Company using the value from Label1 to get the CompanyName where i want to actually filter the Person table by their CompanyName
LookUp(Company, Id = Value(Label1.Text), CompanyName)
What i have done so far is :
I tried using AddColumns to simulate the join functions in SQL, but i realize that the AddColumns functions has limitation to fetch the data just as much as our settings in here.

If the data is less than 2000, i dont mind using the AddColumns.
But the issue is the table will have more than 2000 rows.
And then my question is : how to perform that gallery filtering in Person table by their CompanyName without using AddColumns?
Is there any workaround?
Any suggestion will be gladly accepted.
PS. I'm just a newbie in SQL so please go easy with your suggestion guys.