6 Replies Latest reply on Feb 5, 2018 9:29 AM by Norbert Maijoor

# Date filter - last 13 complete months

Hi,

I need to filter by the last 14 months, for example, from january/2017 to january/2018, but I don´t want to show the current month. Actually I intend to show the last 13 complete months.

The relative filters just give me the option to show the last 14, but without the option of excluind the current one. How can I solve it?

Regards,

Júlia Dreher

• ###### 1. Re: Date filter - last 13 complete months

Create a Calculation

IF Last()=0 Then "Hide" Else "Show" END

Drag it to Filter and Select Show. See Below...I removed Dec 16 data.

Thanks

Deepak

• ###### 2. Re: Date filter - last 13 complete months

Hi Julia,

Find my approach based on Datediff-function as reference below and stored in attached workbook version 10.3 located in the original thread.

1. D1. Display: datediff('month',[date],today())>=1 and datediff('month',[date],today())<=14

2. Drag required objects to the indicated locations and filter D1. Display on True

Regards,

Norbert

• ###### 3. Re: Date filter - last 13 complete months

Just for the fun of offering various diverse options   you could also do:

[Order Date] < DATETRUNC('month',{MAX([Order Date])}) - set this to true and select your last 14 by - add MY (month/year) into filters, go for Top, select 14 on Max of DateTime field you have:

Filtering Based on the Last Date in the Data Source | Tableau Software

However, you mentioned complete months ... what do you actually mean by that ... do you actually want to have full days data for the entire month?

• ###### 4. Re: Date filter - last 13 complete months

Hi, Norbert,

I tried the first option and I worked.

Thanks a lot.

Regards,

Júlia Dreher

• ###### 5. Re: Date filter - last 13 complete months

Hi Julia,

Which First Option worked for you?

Thanks

Deepak

• ###### 6. Re: Date filter - last 13 complete months

Hi Julia,

You are welcome. The thread proves there a many "roads to Rome" in the land of Tableau:)

Happy Analyzing!

Regards,

Norbert