I crreated a calculated field as follows (I am using a French version dd/mm/yyy, you may have to adapt to your own date format):
"Mois" and "Annee" are integers whcih correspond to your "period" and "yr".
Here are the steps
- I create a date with the 1st day of Mois and Annee.
- I add one month to this date
- I substract one day
With this method I nerver have a problem with 30, 31, 28 or 29 being the last day of the month.
Here is calculation that only uses integers.
Integers perform much better than strings and thus something that might be felt.
dateadd('day', -1, dateadd('month', [month], dateadd('year', [year] - 1900, #1/1/1900#)))
Attached workbook version: Tableau 8.1.7