web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter with multiple c...
Power Apps
Answered

Filter with multiple conditions using Excel as data source

(0) ShareShare
ReportReport
Posted on by 14

I have a simple Excel Spreadsheet as my source data, and a DataTable control on a Canvas app. I am having trouble filtering with two conditions. I see many posts on this and they look quite easy to follow, but I am not seeing what I am doing wrong here, because when I apply two conditions, the table shows "we didn't find any data to show at this time".

 

My excel spreadsheet is as below (with just two rows in the sheet):

 

Column1Column2
aa
ab

 

When I filter with one condition I get two rows returned which is correct.

Filter(Table1, Column1 = "a")

 

If I change this (still with one condition) to filter on Column 2 I get one row which is also correct.

Filter(Table1, Column2 = "a")

 

However if I combine these two conditions together on the filter it does not return any rows at all.

Filter(Table1, Column1 = "a", Column2 = "a")

 

Can you please help me understand what I am doing wrong here?

 

David_Morris_0-1665029458772.png

 

David_Morris_1-1665029469308.png

 

David_Morris_2-1665029479166.png

 

 

Categories:
I have the same question (0)
  • BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on at

    Hi @David_Morris 

    you will want to use an & symbol instead of the , if you want both conditions to be true

    if you want it for either conditions then you will use OR 

     

    Filter(Table1, Column1 = "a" & Column2 = "a")
    
    Filter(Table1, Column1 = "a" OR Column2 = "a")
  • David_Morris Profile Picture
    14 on at

    Thanks for the response @BlessedCobba , but I don't believe that is the right solution unfortunately.

     

    The help docs on the Filter command suggests the below, which shows a comma separated list of all logical tests like what I had in the original post.

    Filter(Source, logical_test, logical_test, …)

     

    However, I tried your suggestion anyway, which shows a delegation warning on the "=" and "&" portions of the condition, and also does not return any records.

    David_Morris_0-1665030341957.png

     

     

     

     

  • BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on at

    @David_Morris 
    My Apologies, when doing a filter it uses a && 

    BlessedCobba_2-1665031533104.png

     

     

    You are correct that a comma can be used (i was not aware), I have just always used && instead

    Not sure why yours is returning no results, I have tried it both ways and it seems to work, my only guess is something to do with the data source, i just used a test collection for mine

     

  • Verified answer
    David_Morris Profile Picture
    14 on at

    Thanks @BlessedCobba , using "&& has worked, however that presents a delegation warning which is not optimal 😞

     

    I tried myself with a collection and can confirm it works.

    Collect(Table2,{Column1:"a",Column2:"a"},{Column1:"a",Column2:"b"});

     

    And the original filter command I was using works and returns one row correctly.

    Filter(Table2,Column1="a", Column2="a")

     

    When swapping back to the excel data source as per the original post, I cannot filter on both Column1 and Column2 at the same time using the above filter statement (which is delegable). While using the "&&" has worked, it is not delegable and therefore not optimal.

     

    I will mark your response as an accepted solution given it has in fact worked per the original post, but given the solution throws a delegation warning, I would love to hear if there are any other answers worth trying.

  • BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on at

    @David_Morris 

    A general rule is excel should only be used as a data source for learning how to PowerApps. if you're going to be making an app for use then at a minimum you should be using SharePoint as a data source

    you can export / connect to a SharePoint list from excel if people need to use the data in that way but should never really be the basis of a power app data source

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard