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 Automate / Filtering out rows bas...
Power Automate
Answered

Filtering out rows based on the date

(2) ShareShare
ReportReport
Posted on by 62
I need to filter out rows in a table based on the date in one of the columns from the flow whose picture I have attached. I am wondering what the best way to do it would be. A Filter array action maybe?
 
Flow.jpg
Categories:
I have the same question (0)
  • David_MA Profile Picture
    14,485 Super User 2026 Season 1 on at
    This post shows you several ways to filter an Excel file on a date: Filter Excel Files Based On Date Using Power Automate
  • Verified answer
    Pstork1 Profile Picture
    69,397 Most Valuable Professional on at
    You've got two options.
     
    1) Use an OData query in the List Rows action.  However that is difficult when working with dates, especially in Excel because dates are stored as date and time so to filter on a date usually means filtering on a range that starts and midnight yesterday and goes to midnight today. That is difficult in OData.
     
    2) Use a filter array either before or after the data select.  Before the Select is more efficient since the select doesn't need to process as much. But if you filter after the data select you can use the select to isolate the date from the time and make the filter much easier.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • FN-30071725-0 Profile Picture
    62 on at
    @Pstork1, thanks. I went ahead with the filter array option, but it doesn't give any output.
    I am filtering out only those rows where the date is equal to or 2 days prior to today's date. The code I used was generated using copilot. It is below. Any suggestions on how I could fix this issue?
     
    and(greaterOrEquals(item()?['Date'], formatDateTime(addDays(utcNow(), -2), 'yyyy-MM-dd')), lessOrEquals(item()?['Date'], formatDateTime(utcNow(), 'yyyy-MM-dd')))
  • Pstork1 Profile Picture
    69,397 Most Valuable Professional on at
    So you are trying to get things that are no more than 2 days old?  If so, then that should be the right formula. Is Date the name of the field you are trying to filter on?

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • FN-30071725-0 Profile Picture
    62 on at
    @ Correct, I am using it to get the rows where the date is not more than 2 days old. I used copilot to try and zero in on the reasons behind it, it said that there may be something wrong with the date format itself. 
    But when I run the flow and go into Inputs, I can see that the format is along the lines of "yyyy-MM-dd".
    I am not sure what else I can do to diagnose the issue.
  • Verified answer
    David_MA Profile Picture
    14,485 Super User 2026 Season 1 on at
    Please share a screen shot of what you are doing. If you followed the instructions in the link I posted, you would set up your filter like this:
     
    The expression on the right is: addDays(utcNow(), -2, 'yyyy-MM-dd')
     
    Copilot is telling you to use the date format yyyy-MM-dd because that is an ISO standard, which Power Automate requires for filter queries. Therefore, in the Excel action be sure that you have the date format set to ISO 8601:
    By default, the Excel get rows action only returns the first 256 rows. If your spreadsheet has more than that, you need to enable paging.
     
  • FN-30071725-0 Profile Picture
    62 on at
    @David_MA Thank you for laying that out so well. I messed up while inputting the filter query.
     
    And thank you @Pstork1 for suggesting the filter array after select option. It indeed was a little easier to implement.

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 976

#2
Valantis Profile Picture

Valantis 863

#3
Haque Profile Picture

Haque 547

Last 30 days Overall leaderboard