4 Replies Latest reply on Nov 7, 2017 7:08 AM by Juan Manuel Ferreira

# How to return sales from fiscal year?

Hi how are you?

I have some questions about Tableau and how to return the fiscal years sales, for example.

When I want to return the sales for the actual year, for example, I usually create a calculated field that contains something like this: "if year([date]) = year(today()) then sales else NULL end" and it works only when I perform in to a normal year, but in the fiscal year, I have to limit some month for one year and some month for the next year.

For example, I want to return the sales for the last fiscal year, I usually create a calculated field like this:

"IF (MONTH([Date]) = 1 OR MONTH([Date]) = 2 OR MONTH([Date]) = 1 OR MONTH([Date]) = 2) THEN

IF

(YEAR([Date]) = YEAR(TODAY()) - 1 AND

MONTH([Date]) > 4) or

(year([Date]) = year(today()-2) AND

MONTH([Date]) <= 4)

THEN [Sales]

ELSE NULL

END

ELSEIF

(YEAR([Date]) = YEAR(TODAY()) - 1 AND

MONTH([Date]) > 4) or

(year([Date]) = year(today()) AND

MONTH([Date]) <= 4)

THEN [Sales]

ELSE NULL

END"

But I now sure if in the limit Dates, like January it will work.. And I want a similar formula that can return the actual fiscal year sales.

Many thanks,

See you.

• ###### 1. Re: How to return sales from fiscal year?

Is there a reason you're not using Tableau's built in fiscal year feature?

• ###### 2. Re: How to return sales from fiscal year?

Yes I'm using it, but I still have the problem

• ###### 3. Re: How to return sales from fiscal year?

Got a sample packaged workbook? Mention the version number and I'll see if I can help.

• ###### 4. Re: How to return sales from fiscal year?

Hi, thanks.

I actually work in Tableau 10.4. The data bases that are connected are a bit complicated, but the thing is that, I want to select an specific date, in some cases, I just want to select june 2017 (for example), but in other case I want to select june 2018, or like the quiestion, I want to select all current fiscal year, or all last fiscal year.

Using filters I cant show all this together.

So I performed a formula that if the year is the year I want, the month the same and what ever I want, show me for example sales.

The formula I wrote up is the way that I want to solve it, but Im not able to prove this at all, so i want some help to make this formula perfect. I think that It work, but not sure..

Undesrtand?