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 / Getting Power Automate...
Power Automate
Suggested Answer

Getting Power Automate to delete a row that is over 180 days old

(1) ShareShare
ReportReport
Posted on by 14
I have been working on a scheduled flow to try and get rows within excel that are over 180 days old to be deleted. However using all of the other suggestions that i have searched through mine still does not seem to work. It does not seem to be able to find the data even through there are dates that meet the criteria for deletion. 
 
I have ensured that the ISO8601 is selected for the time and date format and i have also ensured that the time and date format is correctly applied within Excel. 
 
I have tried with two different methods one where we just go to apply to each then i have applied a condition which is dates over 180 days of todays date and i have also tried the method of filter array first. Non have resulted in the deletion of the rows that have been identified. They Key Column is todays Date. 
 
Any advice and support will be welcomed as i cannot work out why it is not working. 
Power 1.png
Power 2.png
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    14,231 Super User 2026 Season 1 on at
    I believe you need to modify this: 
    In your expression, mm returns minutes and not the month value. Month is uppercase MM.
     
     
  • Suggested answer
    Riyaz_riz11 Profile Picture
    4,118 Super User 2026 Season 1 on at
    HI,
     
    Excel stores dates it often saves them as a number like 45678 instead of an actual date format,
    so wrap your date column in formatDateTime(item()?['Todays date'], 'yyyy-MM-dd') to make it readable for the comparison to use proper structure format..
     
    addDays formula needs to be addDays(utcNow(), -180, 'yyyy-MM-dd')
     
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz
  • Vish WR Profile Picture
    777 on at
     
    You could try this see if it works
     
    Use Filter Array (advanced mode):
    @lessOrEquals(
      ticks(item()?['Todays date']),
      ticks(addDays(utcNow(), -180))
    )
  • AB-14040947-0 Profile Picture
    14 on at
    Thank you for your suggestions i have tried both and still i hasn't worked even though there is a date that is suitable. 
     
    I am also not sure how to wrap the data column as suggested, as the data comes from MS Forms and then is pulled across to Excel using another powerautomate.
     
    Thank you for your help though team any further suggestions would be greatly appriciated.
     
  • AB-14040947-0 Profile Picture
    14 on at
    Any further suggestions as this is still currently not working
     
  • Suggested answer
    David_MA Profile Picture
    14,231 Super User 2026 Season 1 on at
    Please show how the dates are formatted in the spreadsheet. The filter action should be working how you have it configured if you adjusted the expression as I mentioned by replacing mm (minutes) with MM (month). I tested this on a spreadsheet with over 27,000 rows and it works. The date format in my spreadsheet looks like this:
     
     
    Also double-check that IS8601 is enabled in the get rows action:
    You can also simplify the filter to use this expression instead: addDays(utcNow(), -180)
    Since my spreadsheet has 27,000 rows, I need to enable paging. If you have more than 254 rows in your spreadsheet, you will need to do this as well (I tested with 10,000 rows to speed up the run):
     
    Result, I have 223 rows in the spreadsheet with a date more than 180 days ago via length(body('Filter_array')) in a Compose action:
     
  • AB-14040947-0 Profile Picture
    14 on at
    Todays date
    10/09/2025
    11/04/2026
    10/04/2026
    09/04/2026
    15/04/2026
    06/04/2026
    07/04/2026
    05/04/2026
    04/04/2026
    03/04/2026
    02/04/2026
    01/04/2026
    31/03/2026
    30/03/2026
    29/03/2026
    28/03/2026
    27/03/2026
     
    is how it is formated in the table and i have ensured that the date format is correct and ISO 8601 is engaged
  • AB-14040947-0 Profile Picture
    14 on at
    This is the output i get i am able to get a successful list and filter but then the apply to each is not successful with errors within the run even though i have applied the correct filters. The data is being pulled across from an MS forms and powerautomated in to the Excel file however i am ensuring that the dates are correct. There are also definately rows that meet the criteria as we are already 180 days beyond. 
     
     
     
     
    Thank you for all of your help
  • Suggested answer
    David_MA Profile Picture
    14,231 Super User 2026 Season 1 on at
    I am glad you got the filtering working. To delete a row, you must have a unique value in the spreadsheet. Is there a column in the spreadsheet that contains unique values? If not, I would recommend adding a column named Row and use the Excel formula =ROW(), which will generate a unique value for you.
     
     
    Then in the delete row action, use this to identify the row to delete.
  • Vish WR Profile Picture
    777 on at
     
    Glad it worked for you, yes, as suggested by @David_MA you need to have a unique ID to identify and delete. 
     
    Note it's case sensitive 
     

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 Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 469

#3
11manish Profile Picture

11manish 364

Last 30 days Overall leaderboard