Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to compare different years but same periods, so it would be for 2020 until today and same period for 2019
For 2020 I have this formula:
Sum({<[Fecha - hora.autoCalendar.Year]= {$(=Max(Year([Fecha - hora.autoCalendar.Year])))}>}[Total])
For 2019 I have this formula:
Sum({<[Fecha - hora.autoCalendar.Year]= {$(=Max(Year([Fecha - hora.autoCalendar.Year]-1)))}>}[Total])
How do I compare two years but for the same period of time as the Max(Year([today])
Try using this formulas for CY YTD and PY YTD: based on your date_column format change the date format to make it work.
CY YTD:
SUM({$<DATE_COLUMN={">=$(=DATE(YearStart(TODAY()),'YYYY-MM-DD'))<=$(=DATE(TODAY(),'YYYY-MM-DD'))"}>}TOTAL)
PY YTD:
SUM({1<DATE_COLUMN={">=$(=DATE((YearStart(AddYears(TODAY(),-1))),'YYYY-MM-DD'))<=$(=DATE(AddYears(TODAY(),-1),'YYYY-MM-DD'))"}>}TOTAL)
hope this helps
Try using this formulas for CY YTD and PY YTD: based on your date_column format change the date format to make it work.
CY YTD:
SUM({$<DATE_COLUMN={">=$(=DATE(YearStart(TODAY()),'YYYY-MM-DD'))<=$(=DATE(TODAY(),'YYYY-MM-DD'))"}>}TOTAL)
PY YTD:
SUM({1<DATE_COLUMN={">=$(=DATE((YearStart(AddYears(TODAY(),-1))),'YYYY-MM-DD'))<=$(=DATE(AddYears(TODAY(),-1),'YYYY-MM-DD'))"}>}TOTAL)
hope this helps