CosteUdPeriodo =
CALCULATE(DIVIDE(SUM(STOCK[Valor stock]),SUM(STOCK[Stock]),0),Calendario[Date] <= MAX(Calendario[Date]))
CosteUdPeriodoAnterior =
CALCULATE(DIVIDE(SUM(STOCK[Valor stock]),SUM(STOCK[Stock]),0),Calendario[Date] <= MAX(Calendario[Date])-365)