Gils
Gils

Reputation: 1

Calculated Column to get previous year

I have a Date table and I want to create a calculated column that gives me the date of the previous year. For example, if the date is 2018 then Previous_Year column should be 2017.

Current Column is [_Year] New Calculated Column is [Previous_Year]

In Dax this is what I have [Previous_Year]= DATE(YEAR([_Year]-1,YEAR))

thanks

Upvotes: 0

Views: 259

Answers (1)

Marco Vos
Marco Vos

Reputation: 2968

Try something like this:

Previous_Year = YEAR('Datetable'[_Year])-1)

I am presuming that [_Year] holds a datevalue and that you want the year of that date minus 1.

Upvotes: 1

Related Questions