cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TerjeF
Advocate III
Advocate III

Combining two values in one filter

Hi

I'm trying to filter a Gallery based on 2 different values in a SharePoint List. Filtering One is easy (Filter(TableName,ColumnName=Dropdown1.Selected.Value)

But, I would like to show content  where the "ProjectName" = XXX and the "ProjectPhase"= YYY. Both X and Y is in the same SharePoint-list.

I've tried &  &&  .  and ! without any results.... 

 

Any good ideas or solutions?

2 ACCEPTED SOLUTIONS

Accepted Solutions
LauraOnu
Power Apps
Power Apps

You can use either && or "And" function, for example:

Filter(Assets, InService=true && AssetType="Tablet") or Filter(Assets, And(InService=true, AssetType="Tablet"))

No need to quote the column names, intellisese adds simple quotes if there are spaces

View solution in original post

CarlosFigueira
Power Apps
Power Apps

In addition to what LauraOnu suggested, you can also pass more parameters to the Filter function, and they will be combined as if they were passed to the And function, like in the example below.

Filter(TableName, ColumnName = Dropdown1.Selected.Value, ProjectName = "XXX", ProjectPhase = "YYY")

View solution in original post

5 REPLIES 5
LauraOnu
Power Apps
Power Apps

You can use either && or "And" function, for example:

Filter(Assets, InService=true && AssetType="Tablet") or Filter(Assets, And(InService=true, AssetType="Tablet"))

No need to quote the column names, intellisese adds simple quotes if there are spaces

CarlosFigueira
Power Apps
Power Apps

In addition to what LauraOnu suggested, you can also pass more parameters to the Filter function, and they will be combined as if they were passed to the And function, like in the example below.

Filter(TableName, ColumnName = Dropdown1.Selected.Value, ProjectName = "XXX", ProjectPhase = "YYY")

Thanks, I went for this and it worked perfect! Great fun!

And what about using "OR" instead of "AND", lets say a want to filter by two conditions, but not both condicitons have to be true, only one of them.

 

Any clue?

You can use the Or operator or the || which is the equivalent.

Check out the operators here at this document.

 

Basic building blocks:

And  &&

Or  ||

Not !

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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