cancel
Showing results for
Did you mean: Frequent Visitor

## Diferencias y usos para TOTALYTD y SAMEPERIODLASTYEAR

Hola,

Me gustaría saber las diferencias entre las funciones TOTALYTD y SAMEPERIODLASTYEAR.

¿TOTALYTD comienza en enero y acaba en el mes que se selecciona?

¿En qué oacasiones usan cada una de las fuinciones?

En mi caso hago necesito hacer un informe financiero y calcular el "Year today" de varios años. Por ejemplo necesito volúmenes desde enero a junio de este 2022 y de los años 2021, 2020 y 2019... ¿qué función es la más recomendable apra este caso?

Gracias!

1 ACCEPTED SOLUTION  Super User

@Josevi , Totalytd, sum up data till date from the start of the year (Date in the rows or context)

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

SAMEPERIODLASTYEAR

give data  1 year behind. Period will be decided by row or the filter context

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

almost same as

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

2 REPLIES 2  Super User

@Josevi , Totalytd, sum up data till date from the start of the year (Date in the rows or context)

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

SAMEPERIODLASTYEAR

give data  1 year behind. Period will be decided by row or the filter context

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

almost same as

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))  Super User

@Josevi , Totalytd, sum up data till date from the start of the year (Date in the rows or context)

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

SAMEPERIODLASTYEAR

give data  1 year behind. Period will be decided by row or the filter context

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

almost same as

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))   