cancel
Showing results for
Did you mean:
Helper II

## Year to Date last year

Hi I am using the working formula below to calculate our YTD turnover.

YTD_2020 = CALCULATE(SUM('FACTVERKOOP_ALL'[BRUTO_OMZET]);YEAR('FACTVERKOOP_ALL'[DATE])=YEAR(TODAY()))

What formula can I use to get the result for the year before?

Many thanks in advance

1 ACCEPTED SOLUTION
Super User IV

@BartVlek , With a date table

LYTD QTY = TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year))

LYTD QTY forced=
var _max = date(year(today())-1,month(today()),day(today()))
return

or

LYTD QTY forced=
var _max = date(year(today())-1,month(today()),day(today()))
return

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

2 REPLIES 2
Super User IV

@BartVlek , With a date table

LYTD QTY = TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year))

LYTD QTY forced=
var _max = date(year(today())-1,month(today()),day(today()))
return

or

LYTD QTY forced=
var _max = date(year(today())-1,month(today()),day(today()))
return

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Solution Specialist

var maxyear = YEAR(TODAY())

YTD_2020 = CALCULATE(SUM('FACTVERKOOP_ALL'[BRUTO_OMZET]);YEAR('FACTVERKOOP_ALL'[DATE])=maxyear)

and you can use the same substratct one to geet last year

var maxyear = YEAR(TODAY())

LYTD_2019 = CALCULATE(SUM('FACTVERKOOP_ALL'[BRUTO_OMZET]);YEAR('FACTVERKOOP_ALL'[DATE])=maxyear-1)

And to confirm are you looking for Full year else the same dates available in latest year with the last year?

If you think this is helpful please Accept this as Solution and leave a like.

Regards,

Manikumar

Announcements

#### Happy New Year from Power BI

This is a must watch for a message from Power BI!