Please can you share a sample workbook.
Or some screenshots of what you are trying to achieve.
This sounds like you either need to utilise parameters but will be in a better position to answer you after some screenshots or a sample workbook.
Here is my data
The result I want to archive is similar to this (the number is different from my data):
I've posted nearly the exact same solution in this post yesterday: Dynamic MoM and Months as Parameter
Instead of using month as a date setting you would be using year inside the DATETRUNC() and DATEADD() formulas. To be fair the main formula could then best be handled a bit easier if its the year:
IF YEAR([Date]) = YEAR([Date Parameter]) THEN 'Current Year'
ELSEIF YEAR([Date]) = (YEAR([Date Parameter]) - 1) THEN 'Previous Year'
ELSE 'Other Years' END
This assumes you are using a Datefield and aggregating within tableau if its not a datefield an just the integer 2001, 2002, etc. It becomes easier. You just remove all the YEAR() Functions in the above statement as there is no reason to convert a date to an integer.
I will try you solution and will let you now if I get stuck with anything.
khalid norat wrote:
My post is being moderated for some reason hopefully you can see this file
Your post has been moderated and is visible.
This is exactly what I am looking for
Thank a lot for your support,