Skip to main content

Hi,

 

I need a calculated field to show the given measure for a given time period,

 

For example I want to be able to show Revenue for 2017 in a calculated field.

 

This may be fairly easy but I'm struggling a bit and need help!

 

The reason I need this in the view as a calculated field is I have a series of Quick Calculations calculating % difference to last year, I then want to hide one of the years, but hiding a year hides everything in the view for that year.

 

So I need 2017 revenue to be fixed in the view even if 2017 as a 'year dimension' is hidden.

 

I hope that makes sense. So it would be [year]=2017 [revenue] or something along the lines but I don't know how to write it properly in Tableau

 

Thanks,

Jordan

5 answers
  1. Nov 6, 2018, 3:55 PM

    The shape of your sheet dictates that 2016 will show up for all measures because YEAR is on the sheet.

     

    The method I suggested lets you take 2016 off the sheet, and you'll notice that 2016 data is still available for the %YOY calcs to do their thing.

     

    If you want to display "this year" and "last year" and then show a calc that is a function of those two numbers, re-shape your sheet as I have shown in the second sheet in the attached.  (I did it for quantity.  You'll need to do it for sales.)

0/9000