2 Replies Latest reply on Oct 23, 2018 6:03 PM by swaroop.gantela

# Calculated Field to

Hi, new to Tableau and trying to figure out if there is a simple solution to do the following.  I have a calculated field from my data source for each calendar year suming gifts for that year for each lookup ID (example below).  I would like to have a new value that would show me the value for whatever is most recent.  So in the first row below, I would want the new value to read: \$1,000, 2014 in the 4th row I would want this new value to read: \$1,000, 2016.  Is something that that possible?

• ###### 1. Re: Calculated Field to

Hi, Elayfield

Yes, it is possible, but the solution will be various depending on how your data and workbook looks like, if you could share a sample workbook will be easier to show how to achieve it.

ZZ

• ###### 2. Re: Calculated Field to

Welcome to the Forum.

I think it will be tricky with your data arranged as shown above.

But, if your datasource type will allow, it should be readily achievable

if you can pivot your data:

Pivot Data from Columns to Rows

Then you can use Level of Detail calculations to affix to the Lookup ID

its most recent year:

{ FIXED [LookupID] : MAX( IF [Value] > 0 THEN [Year] END ) }

And the value at the Max Year:

{ FIXED [LookupID] : MAX ( IF [Year] = [MaxYear] THEN [Value] END ) }

This can also be done in Tableau Prep.

If all this won't work for your datasource, we can look into a more complex method:

Vizible Difference: Turning Measure Names into a Dimension