cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ashok2
Post Patron
Post Patron

Filter gallery from child list

Hi All 

 

I am using below formula to filter my gallery from my POAMaster list 

//Filter(POAMaster,'Created By'.Email=User().Email);
If(
     showAll = "All",
    Sort(POAMaster,ID,Descending),
    showReport = "Report",
Sort( Filter(
        POAMaster,User().Email=User().Email,
        If(
            IsBlank(Dropdown1_10.Selected.Result),
            true,
            InitatorName.DisplayName = Dropdown1_10.Selected.Result
        ) && If(
            IsBlank(Dropdown1_12.Selected.Result),
            true,
            AttorneyFor.Value= Dropdown1_12.Selected.Result
        ) && If(
            IsBlank(Dropdown1_11.Selected.Result),
            true,
            GrantorSociety.Value = Dropdown1_11.Selected.Result
        ) && If(
            IsBlank(Dropdown1_13.Selected.Result),
            true,
            Status.Value = Dropdown1_13.Selected.Result
        ) 
        ),ID,Descending)
)

This list is having relational data in another list for one item in POAMaster there may be n child in POAChild list below is the example

POAMaster

PguidColumn1Column2``
1001Test1212Teste111
1002Test2223232



POAChild

PguidColumnNameColumnAddress
1001Ashok 
1001Ashok123 
1001Ashok1234 
1001Ashok12345 
1002Ashok 
1003Ashok 
1004Ashok12345 


now i have to add additional Filter from POAChild list ColumnName to filter my gallery and ColumnName can have repeated entries like Ashok can be in 1001 and 1002 as well .

 

Can anyone help me on this ?

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Community Champion
Community Champion

@Ashok2 First, u'll need to have this in the Items for the New dropdown,

Distinct(POAChild, ColumnName)

Then you can add this condition to your main Filter,

If(
   IsBlank(yourNewDropDown.Selected.Result),
   true,
   Pguid in ShowColumns(Filter(POAChild, ColumnName in yourNewDropDown.Selected.Result), "Pguid")
) 

 

Please get back to me if you have any issues.

 

View solution in original post

8 REPLIES 8
CNT
Community Champion
Community Champion

@Ashok2 Do you want the gallery to display results from POAMaster or POAChild? At present u'r filtering POAMaster and it's not clear how/why you want to include a criteria from POAChild (another list) while filtering POAMaster?

@CNT  i want to filter data from POAMaster but one of my dropdown should be from POAChild as if user select Ashok in dropdown it should display him two result as Ashok is part of 1001 and 1002 is this achievable ? 

Let me know is this not feasible 

CNT
Community Champion
Community Champion

@Ashok2 First, u'll need to have this in the Items for the New dropdown,

Distinct(POAChild, ColumnName)

Then you can add this condition to your main Filter,

If(
   IsBlank(yourNewDropDown.Selected.Result),
   true,
   Pguid in ShowColumns(Filter(POAChild, ColumnName in yourNewDropDown.Selected.Result), "Pguid")
) 

 

Please get back to me if you have any issues.

 

View solution in original post

@CNT  Tried using it but not getting correct results  when i am filtering 

CNT
Community Champion
Community Champion

@Ashok2 Try it in parts, just do this bit first (put it into a collection) and check the results,

ShowColumns(Filter(POAChild, ColumnName in yourNewDropDown.Selected.Result), "Pguid")

I tried but getting not correct result in collection for ex i selected in dropdown "6a5246e7-c4fd-415f-9291-2995f5506489"

Ideally it should written me one value in collection but getting more then one 

Ashok2_0-1622045523237.png


Below is my Data source  in POAChild where it show for two Pguid results but only one contain "6a5246e7-c4fd-415f-9291-2995f5506489" in FullNames (ColumnName)

Ashok2_1-1622045577020.png

 




@CNT  if i do like below hard code it show me expected result 

 

ClearCollect(TestRaw,ShowColumns(Filter(POAChild, FullNames = "6a5246e7-c4fd-415f-9291-2995f5506489"), "Pguid"))

CNT
Community Champion
Community Champion

@Ashok2 Now try this,

ClearCollect(TestRaw,ShowColumns(Filter(POAChild, FullNames = yourDropDown.SelectdText), "Pguid"))

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,082)