Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Value for Last Year

Hi All,

 

I have a situation where I want to check numbers for last year for my quarter.

By using the below calculation I can calculate data for the last year same date data eg. If today is 31-01-2023, I can check data for last year same date i.e 31-01-2022.

 

 

Now I want to check data for my last year which starts from 02-01-2022 to 31-01-23 but same expression is not working for that.

Any help regarding this?

 

Also I have made a calculated column for SameDay Last Year which is giving me data for last year same day:

 

SameDayLY =
var TodayDate = TODAY()
var LastYear = YEAR(TodayDate)-1
var LastMonth = MONTH(TodayDate)
var LastDay = DAY(TodayDate)
return
ACV[CLOSE_DATE]= DATE(LastYear,LastMonth,LastDay)
 
I want something like below to work but instead of the date "01-31-2023" I want to add some condition so that it dynamically takes same date of last year.
 
LastYearData =
    CALCULATE (
        [ACV],
        DATESBETWEEN(ACV[CLOSE_DATE],"02-01-2022","01-31-2023")
 
The start date i.e "02-01-2022" I can hard code as it will change just once each year but how to make the end date dynamic? I want it to take the same date of last year like tomorrw the end date should be "02-01-2022" and so on.

 

Regards,

Himanshu

 

1 Reply