4 Replies Latest reply on Nov 19, 2018 4:08 AM by Akram Ebrahim

# how to display previous year totals and % change from previous year into current year in tableau without creating parameters

how to display previous year totals and % change from previous year into current year in tableau without creating parameters

• ###### 1. Re: how to display previous year totals and % change from previous year into current year in tableau without creating parameters

Hi Manoj,

To Calculated Previous year total

if year([Date])=Year([today()])-1

then [Total] end

Ratio %

(

if year([Date])=Year([today])-1

then [Total] end

)

/

(if year([Date])=Year([today()])

then [Total] end)

• ###### 2. Re: how to display previous year totals and % change from previous year into current year in tableau without creating parameters

Hi Manoj,

Find my approach as reference below and stored in attached workbook version 2018.2 located in the original thread

1. YTD: {fixed: sum(if datediff('year',[Date],today())=0 and [Date]<=today() then [Sales] END)}

2. PYTD: {fixed: sum(if datediff('year',[Date],today())=1 and [Date]<=dateadd('year',-1,today()) then [Sales] END)}

3. % difference: ([YTD]-[PYTD])/[PYTD]

Hope it helps,

Regards,

Norbert

• ###### 3. Re: how to display previous year totals and % change from previous year into current year in tableau without creating parameters

Total = ?

• ###### 4. Re: how to display previous year totals and % change from previous year into current year in tableau without creating parameters

Total should be a calculated measure or field you are going to use in the worksheet.

Just an idea alias name for the calculation from my side.