To get the number of days elapsed in the current month create the following calculated field:
DATEDIFF('day',DATETRUNC('month',today()),today())
To get the number of days elapsed in the current quarter create the following calculated field:
DATEDIFF('day',DATETRUNC('quarter',today()),today())
To get the number of days elapsed in the current year create the following calculated field:
DATEDIFF('day',DATETRUNC('year',today()),today())
To get the number of days in the current month dynamically:
DATEPART('day', DATEADD('day', -1, DATEADD('month', 1, DATETRUNC('month', [Date]))))
Some uses: Track goals and targets. For instance, let's say your sales goal is $10,000 per month. If you are 23 days into the month then you can use the formulas above to see where you should be in terms of the number of days that elapsed in the month.
Some tips:
The latter calculation depends on the filter context which is a fancy way of saying it depends on what dimensions/measures are in the row or column shelf in tableau.