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 / Copilot Studio / Copilot Studio flow qu...
Copilot Studio
Answered

Copilot Studio flow question: true calendar month vs last 31 days

(0) ShareShare
ReportReport
Posted on by 4

Hi everyone, I’m building a Copilot Studio flow to automate our monthly newsletter.

Current setup

  • The flow runs once a month
  • It pulls messages from a Teams channel
  • Right now, the time filter uses something like:
    addDays(utcNow(), -31)
    
  • This means it’s pulling the last 31 days, not the actual calendar month

What I’m trying to solve I want the flow to:

  • Pull data from the true previous calendar month
    (e.g., Jan 1–Jan 31, Feb 1–Feb 28)
  • Still run automatically on a monthly schedule
  • Work cleanly across different month lengths

Question What’s the best way to implement true monthly date logic in Copilot Studio / Power Automate?

  • Is there a recommended expression pattern for start/end of last month?
  • Or a best practice when filtering Teams messages by calendar month?

Any examples or guidance would be much appreciated. thank you!

Categories:
I have the same question (0)
  • David_MA Profile Picture
    14,956 Super User 2026 Season 1 on at
    I am not sure I fully understand what you are doing, but I think I know how you can achieve what you want. If you're using a filter query, and you want to get the items for the prior month. Use these two expressions in your filter query:
    • subtractFromTime(startOfMonth(utcNow()), 1, 'Month')
    • startOfMonth(utcNow())
    The first expression gets the first day of the prior month (2026-01-01) and the second expression gets the first date of the current month (2026-02-01). Then you just need to filter query where your date field is greater than or equal to the first and expression and your date field is less than the second expression.
     
     
    Note: this assumes your flow runs in the month following the month you want to get items from. If the flow runs in the same month, then you can just use the second expression.
  • Suggested answer
    chiaraalina Profile Picture
    2,425 Super User 2026 Season 1 on at
     
    Please see first answer. Didn't see the answer before as I had the question open for too long.
  • David_MA Profile Picture
    14,956 Super User 2026 Season 1 on at
    That is the same answer I posted. 🤣

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 277

#2
11manish Profile Picture

11manish 206

#3
sannavajjala87 Profile Picture

sannavajjala87 156 Super User 2026 Season 1

Last 30 days Overall leaderboard