5 Replies Latest reply on Jan 14, 2016 9:51 AM by Tina Hauser

# Calculated Field for FYTD and previous full month

First, let me start off by saying that I am a relatively new user to Tableau and need help with what appears to be a pretty complex requirement.

First, our client's fiscal year is set to July - June and not the calendar year. Originally, they wanted to see their sales total by FYTD, and so I created this calculated measure:

Now, they would also like to see their sales total by FYTD for the previous full month, so today (1/13/16) would only show total sales for 7/1/15 - 12/31/15.

How do I achieve this result?

Thank you in advance to all!

• ###### 1. Re: Calculated Field for FYTD and previous full month

Hi Melinda!

Instead of a calculated field for the fiscal year, you can set this in Tableau by clicking on your date field, and selecting default properties --> Fiscal year start --> ...  I've attached a screenshot of this.

After you set that you won't need the calculated field, which should make subsequent calcs more simple. Let me know if this solves the problem or if you'd like me to take a closer look.

• ###### 2. Re: Calculated Field for FYTD and previous full month

Hi Tina;

Thank you so much for your quick response. Once I set the fiscal year in the default properties, how do I then analyze sales for the previous completed month?

• ###### 3. Re: Calculated Field for FYTD and previous full month

There could be multiple solutions depending on what you plan to do with the sales total and what else will go on your worksheet.

I've attached a workbook showing how you can use date functions to:

1. identify the month of the current date

2. identify the month of each date in your data

You can then create a calculated field that returns true or false based on if #1 = #2 above. Then use that calculated field as a filter.

Then, filter on date using "relative dates" (picture attached) and choose year to date.

Let me know if you have add'l questions. :-) Tina

• ###### 4. Re: Calculated Field for FYTD and previous full month

Thank you again, Tina; I will give this a try ☺

Have a nice day,

Melinda

• ###### 5. Re: Calculated Field for FYTD and previous full month

You're welcome - please mark replies as helpful or correct answer once you're ready. Thanks!