YTD metrics can be calculated using the native time intelligence DAX functions such as TOTALYTD() and DATESYTD().