How to get a date 30 days ago for a filter query in Power Automate
Updated 2 November 2026
The expression:
formatDateTime(addDays(utcNow(), -30), 'yyyy-MM-dd')
The date a month back, in the ISO form filters understand.
Where it goes
Inside a Filter Query: Created ge '…' (paste it between the quotes with the fx box, or build the whole filter with concat).
- In the Power Automate designer, click in the box that needs the value.
- Select the fx (Expression) button that appears next to the dynamic content list.
- Paste the expression and select Add. It should appear as a purple fx chip; if you can see it written out as text, it went in as plain text and won't run.
Example output
2026-09-30 (illustrative; AutomateAlong doesn't run expressions)
The common mistake
Created ge 'addDays(utcNow(), -30)'
Typed into the Filter Query box as text, the expression is sent to SharePoint as the literal words. Build the date with the fx button and put only the quotes around the chip.
Change it for your flow
Step names inside an expression must match your steps exactly, with underscores for spaces: Get_items, not Get items. To adapt it, open it in the Expressions checker, which points at any bracket, quote or name that's wrong and suggests the corrected version. To write a different one from plain English, describe what you need on the same page.
Related
- How to get the first day of the month in Power Automate
- How to get the day of the week as a name in Power Automate
- How to add days to a date in Power Automate (addDays)
- How to show the current UK time (HH:mm) in Power Automate
- How to make a Power Automate flow run only on weekdays
AutomateAlong is independent and isn't affiliated with Microsoft. Microsoft and Power Automate are trademarks of the Microsoft group of companies.