This is an issue that comes up once in a while. There are always multiple alternative solutions to the same issue in Tableau. Here is my favorite one. Simple and easy. No need to use Index() function. It applies to current month/year or last N months/years.