If I can make another suggestion along these lines - stick with @Melissa’s Extended Date Table code, but use the following techniques to make the start and end dates dynamic, as you suggest.
The Extended Date Table gives you tremendously powerful time intelligence capabilities. We did a whole video series on how to utilize these capabilities that you can find here: