cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Power Apps
Power Apps

Re: Combining two values in one filter

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

Highlighted
Power Apps
Power Apps

Re: Combining two values in one filter

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
Highlighted
Power Apps
Power Apps

Re: Combining two values in one filter

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

Highlighted
Power Apps
Power Apps

Re: Combining two values in one filter

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

Highlighted
Advocate III
Advocate III

Re: Combining two values in one filter

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

Highlighted
Helper II
Helper II

Re: Combining two values in one filter

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?

Highlighted
Super User
Super User

Re: Combining two values in one filter

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
secondImage

New Return to Workplace

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

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,627)