Forum Discussion
M_SBS_6
2 years agoHelper V
M dates
Hi,
How I do in power query write out previous year to date?
I have a Year to date flag using date.isinyeartodate(app_date). I just want the same thing but for last year. Any ideas please?
pls try this
Date.IsInCurrentYear( Date.AddYears( [app_date],1) ) = true and [app_date] <= Date.AddYears(Date.From( DateTime.LocalNow()),-1)
4 Replies
- AhmedxSuper User
pls try this
- M_SBS_6Helper V
Thanks. This gives me the whole of last years view but I need last years year to date
- AhmedxSuper User
pls try this
Date.IsInCurrentYear( Date.AddYears( [app_date],1) ) = true and [app_date] <= Date.AddYears(Date.From( DateTime.LocalNow()),-1) - AhmedxSuper User
and try this
[ t1 = Date.AddYears(Date.From( DateTime.LocalNow()),-1), t2 = Date.StartOfYear(t1), Result = [app_date]>= t2 and [app_date]<=t1][Result]