I have two control fields:
A. Date
B. Slider (months)
I want to take A - B and output is a a date.
For example
A = Dec 2022
B = 3
It should output as Sept 2022.
p.s
Coming from notions where there is so much content on how to do date math formulas and I spent the better part of an hour here and could not find a single thing related to this.
Add-on: Here’s a quick example using RelativeDate()
The date (the blue one) I used is Today() displayed as MMM YYYY
(Today() is still a full date behind the scene though, the format is really just a display)
There’s a slider to determine the month offset (currently set to 3)
Then, there’s the canvas formula (the green one) which returns the relative date from Today() with an offset of -3 months (so RelativeDate() subtracts the months from today’s date).
The date the formula returns is also formatted as MMM YYYY but again, behind the scene, it’s still a full date .
The canvas formula is :
Date.RelativeDate(-[Month Offset])
And there’s another canvas formula (the orange one) which returns the relative date from Today() with an offset of 3 months this time (so RelativeDate() adds 3 months to today’s date).
Once again, the date RelativeDate() returns is formatted as MMM YYYY but there’s still a complete date behind it .