I do not have any experience writing MDX equations. I do know of some resources in regard to custom dates in MSAS.
A snippet in the following blog from the VizPainter blog touches on dates with MSAS and Tableau: Tableau and Cubes (OLAP) | VizPainter, .
Also there is some additiona information in the tableau online help on creating custom dates https://onlinehelp.tableau.com/current/pro/desktop/en-us/help.html#dates_custom.html
Hope this helps!