7 Replies Latest reply on Nov 30, 2012 5:35 PM by Marc Maschette

Fraction of amount based on elapsed days in month

Hi Guys,

I am chasing a Calculation that will allow me to show a fraction of our budget for the month based on the amount of days into the month we are so for example if our monthly budget was 10k and we were 10 days into the month then our shown budget would be 3.33k.

Cheers

• 1. Re: Fraction of amount based on elapsed days in month

I'll be interested to see what happens to this formula tomorrow, when it uses Jan. 1 2013 to determine the last day of the month for Dec. Just have to wait and see.

--Shawn

• 2. Re: Fraction of amount based on elapsed days in month

It gets complex, but I think mine accounts for the year roll over.

Looking at yours Shawn, I think it will work fine for the year over assuming the calc is correct

• 3. Re: Fraction of amount based on elapsed days in month

I do to Alex, but when I comes to Date stuff Tableau has a way of surprising me every once in a while.

--Shawn

• 4. Re: Fraction of amount based on elapsed days in month

What value do you get for dec 31st? It looked like I was getting 103.3%

• 5. Re: Fraction of amount based on elapsed days in month

Alex I got the same thing. I'm working on it. Stand by...

--Shawn

• 6. Re: Fraction of amount based on elapsed days in month

Alex & Marc, I'm pretty sure I got it this time. Here's the formula:

THEN

ELSE 1

END

To test it, change your system clock and then refresh the data source. I tested Oct. Nov & Dec. 2012 and Jan. & Feb. 2013. They all worked, and the percentages were accurate.

Alex thanks for helping me find my mistake.

--Shawn

• 7. Re: Fraction of amount based on elapsed days in month

Thanks guys, i will test and advise!