Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

YTD difference between 2 dates

Dear All   I'm just trying to create a line chart by week that shows a punctual difference between 2 dates and the related YTD.   For the punctual calculation we succeed using also an holiday cal...
  • amitchandak's avatar
    6 years ago

    Anonymous , have tried using use relation with datesytd

     

    like this example

    YTD 1 = CALCULATE(SUM('CALENDAR'[is work day]),DATESYTD('Date'[Date],"12/31"),USERELATIONSHIP('Table'[Date1];CALENDAR[Date]))
    
    YTD 2 = CALCULATE(SUM('CALENDAR'[is work day]),DATESYTD('Date'[Date],"12/31"),USERELATIONSHIP('Table'[Date2];CALENDAR[Date]))