1 of 1 people found this helpful
I had to deal with something similar and found the only way around was to check the month and the year with and IF / And statement
datepart('month',[date parameter] )
datepart('year', [date parameter])
Not sure what else you have in your dimensions that you can check year against
Hope it helps - even a little
2 of 2 people found this helpful
To share sensitive data, anonymize your data. See this 10 minute video that shows how. We may need to see a workbook at some point, so I recommend that you start working on this:
Where are you generating your [... current ...] and [... prior...] fields from?
You can just store your data with date values in the rows, and Tableau's magical date handling can do the math for you. And tableau doesn't care about year boundaries. So there are myriad ways you can get last month's data right from the data as it comes in from your data source.
For instance, DATEADD('month',-1,[date field]) will subtract a month. Doesn't matter if it is July or January. Doesn't matter if the field is a fiscal date or calendar date.
If your sheet is set up with monthly cells, LOOKUP(<whatever>, -1) will grab <whatever> from the prior month. Again, no problem with year boundaries.
Thanks Joe - that would have been much easier than what I did