cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Premwong13
Level: Powered On

Filter Data

Dear all, 

If(
    CountRows(
        Filter(Data1, Located&Category = Where.SelectedText.Value&What.SelectedText.Value)
    ) <>0,
    Filter(Data1, Located&Category = Where.SelectedText.Value&What.SelectedText.Value),
    If(
        CountRows(
            Filter(Data2, Located&Category = Where.SelectedText.Value&What.SelectedText.Value)
        )<>0,
        Filter(Data2, Located&Category = Where.SelectedText.Value&What.SelectedText.Value),
        If(
            CountRows(
                Filter(Data3, Located&Category = Where.SelectedText.Value&What.SelectedText.Value)
            ) <>0,
            Filter(Data3, Located&Category = Where.SelectedText.Value&What.SelectedText.Value)
        )
    )
) 

I have 3 Tables, if I select my drop down boxes, 2 boxes, and they match with my data in those 3 Tables,

all items that items should show in my Gallery5. 

 

My problem is when I select the drop boxes and they match with Data1, it'll not process to Data 2 and 3.

And Gallery5 show only items that come from Data1.

 

Could you help or guide me how to fix it ? 

 

Thanl you  

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Filter Data

@Premwong13 

 

 
You are getting error in your current expression is because of a multi-condition if statement, it will not look for 2 or 3rd condition if 1st condition is fulfilled, this is just like if,elseif and else loops.
 
To overcome this, if you will create a local collection you can directly refer to all the content inside the collection into your gallery items and you do not need to filter each data source separately.
 
You can use this expression for above scenario:
 Filter(ComboBoxValues, Located&Category = Where.SelectedText.Value&What.SelectedText.Value)
This collection will have all the attributes of your data source.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

1 REPLY 1
Dual Super User
Dual Super User

Re: Filter Data

@Premwong13 

 

 
You are getting error in your current expression is because of a multi-condition if statement, it will not look for 2 or 3rd condition if 1st condition is fulfilled, this is just like if,elseif and else loops.
 
To overcome this, if you will create a local collection you can directly refer to all the content inside the collection into your gallery items and you do not need to filter each data source separately.
 
You can use this expression for above scenario:
 Filter(ComboBoxValues, Located&Category = Where.SelectedText.Value&What.SelectedText.Value)
This collection will have all the attributes of your data source.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helpful resources

Announcements
thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,578)