cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
Dual Super User III
Dual Super User III

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
Highlighted
Dual Super User III
Dual Super User III

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (2,356)