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 / Problem - Filtering in...
Power Apps
Answered

Problem - Filtering in two tables

(0) ShareShare
ReportReport
Posted on by 105

Hi guys,

I have a problem when I try to show data from two different tables.

 

For examble, I have 2 tables:

 

CategoryJob
Cat_1Job1
Cat_2Job2
Cat_3Job3
Cat_4Job3
Cat_5Job3
Cat_6Job2

 

DepartmentJob1Job2Job3
D1Employee1Employee2Employee3
D2Employee4Employee5Employee6
D3Employee7Employee8Employee9

 

I need a gallery that if you select a "Category" item and "Department" item, results a Gallery with "Heading" Job selected (Job1, Job2, Job3), and "Body" name of employee, depending of "Department" has been selected.

 

If someone can help me.

 

KR

Categories:
I have the same question (0)
  • Verified answer
    Brian Dang Profile Picture
    3,976 on at

    You will need to use conditions to solve this.

     

    First I replicated your data using Table():

    ClearCollect(table1,
     Table(
     {Category: "Cat_1", Job: "Job1"},
     {Category: "Cat_2", Job: "Job2"},
     {Category: "Cat_3", Job: "Job3"},
     {Category: "Cat_4", Job: "Job3"},
     {Category: "Cat_5", Job: "Job3"},
     {Category: "Cat_6", Job: "Job2"}
     )
    );
    
    ClearCollect(table2,
     Table(
     {Department: "D1", Job1: "Employee1", Job2: "Employee2", Job3: "Employee3"},
     {Department: "D2", Job1: "Employee4", Job2: "Employee5", Job3: "Employee6"},
     {Department: "D3", Job1: "Employee7", Job2: "Employee8", Job3: "Employee9"}
     )
    )

    The data is already in your app, so you don't need that step.

     

    Next I created ListBox1 and ListBox2. One to house data from table1 and one to hold data from table 2.

    two filter 1.png

    You could use a Dropdown or Radio control instead--they all work so you can make a selection.

     

    Create Gallery1. Change its items to include the condition below. The first condition narrows down table2 so that it only shows the department selected in ListBox2:

    Filter(table2,Department=ListBox2.Selected.Department)

     

    Add a Label inside Gallery1; the formula below will show the right employee based on the category selected in ListBox1. The Job column in table1 references a column in table2. PowerApps can't understand that it is the name of a column, so a condition is needed to show the right column:

    If(ListBox1.Selected.Job="Job1",Job1,
     ListBox1.Selected.Job="Job2",Job2,
     ListBox1.Selected.Job="Job3",Job3
    )

    Let me know if this works.

  • luisep Profile Picture
    105 on at

    Thanks a lot for your instructions.

     

    KR

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,074

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 606

Last 30 days Overall leaderboard