5 Replies Latest reply on Oct 22, 2018 12:03 PM by chakradhar kakani

# calculate number of days in Month Dynamically (for incomplete month)

Hello All,

I'm trying to calculate no of days in month dynamically, for example (screenshot below) for month of sept i have 30 days and for Oct i have 31 days which is correct but as the current current month is not over, i want to show number of days that have passed in the current month dynamically along with the rest of months showing it number of days

below is the formula i would appreciate if anyone can please provide possible solution or tweak it

• ###### 1. Re: calculate number of days in Month Dynamically (for incomplete month)

Hello,

You can try below logic:

total days in month

{FIXED YEAR([Date]),MONTH([Date]): MAX(INT(DATENAME('day',[Date])))}

Days in Month

if MONTH([Date])=MONTH(TODAY())  THEN INT(DATENAME('day',TODAY())) ELSE [total days in month] END

• ###### 2. Re: calculate number of days in Month Dynamically (for incomplete month)

Meenu Choudhary

Hello

I am Fairly new to Tableau, and seeing what you doing on here, I will appriciate if you can mentor me in this line discipline.

Thanks

• ###### 4. Re: calculate number of days in Month Dynamically (for incomplete month)

Meenu Choudhary