I have a flow that formats a spreadsheet to only show transactions that closed last month.
How I’m doing it now is hard coding that month in. For example, we’re in May (month 5) right now, so last month is April (month 4) and I edit my flow this month (and once every month) to change this number to 4: https://d.pr/i/lz8lnj
Perhaps this would be a good place to use the Date Comparison step, and set the units to Months between your date and today. That should give you between 0 an 1 for dates in the current month, which you can then filter by.
Hey Brian! Thanks for the tip! Good start, but it doesn’t work out in a scenario where today is 9/22 and let’s say the subject dates are 8/29 and 9/1. Using that formula, the months in between for both is less than 1, but it wouldn’t be enough of a distinction to determine last month or this month
Hey @Cary_Wan - Do you imagine you’d like to run this flow at the beginning of every month to show the transactions that were closed last month? I’ve been thinking about a few different ways to do this. It’s a little tricky because our Insert Date & Time step has an offset feature which I can only offset by day and we need to account for when you’re running the flow in January and need it to also be looking at the previous year.
Here’s something I came up with that should be pretty durable:
Then we’ll create two branches with the Remove rows step. One where “Current month” does not equal 1 (meaning “not January”) and another where "Current month does equal one (meaning “January”
).
From the top “not January branch”, your Insert math column step looks like this: