I'm trying to do some periodic comparisons and I'm struggling to come up with a formula to return the appropriate designation for "Quarters". My current formula is below, but given the data in the screenshot, I want to show Jan, Feb, and Mar months as "Prior" when I'm current in Q3, and then when we move to Q4, Apr/May/Jun will become "Prior", "Jul/Aug/Sept" will become "Last", "Oct/Nov/Dec" will become "Current", and "Jan/Feb/Mar" will become "Next". I'm a bit skeptical whether the "Next" logic will work as I intended but it's the best I could come up with. I'm all ears if there is another solid solution. Thank you in advance!
Month Formula:
if [End Date] = "2020-08-31" then "Current"
elseif [End Date] = datetimeformat(datetimeadd("2020-08-31",-1,"months"),"%Y-%m-%d") then "Last"
elseif DateTimeMonth([End Date]) > DateTimeMonth("2020-08-31") then "Next"
else "Prior" endif
Quarter Formula:
if [Quarter#] = "Q" +ToString(CEIL(DateTimeMonth("2020-08-31")/3)) then "Current"
elseif [Month] = "Next" then "Next"
else "Last" endif
Solved! Go to Solution.
Hi @EYU07 — Hope attached the solution will be helpful, if not let me know.
@jdunkerley79 has written brilliant expressions for Quarter calculations (Link)!
If it resolves your query please mark it "Solved" or "Solved" with a Like. This will help other users find the same answer/resolution. Thank you.
Thank you so much, it worked!