title: YTD filtering by category - DAX / Power BI
body: <p>I have a 'Table' with three columns: Date, Location, Value.</p>
  
  <p>I also have a table 'Tabledates' with a continuous set of dates. Relationships are correctly set.</p>
  
  <p>I have created a measure called YTD with code:</p>
  
  <blockquote>
    <p>CALCULATE( SUM( Table[Value] ); DATESYTD( Tabledates[Date] ))</p>
  </blockquote>
  
  <p>On any graph, the YTD measure is perfect, but if I filter by location, the results of YTD are totally wrong.</p>
  
  <p>Any hint?</p>
  
  <p><a href="https://i.stack.imgur.com/pEOpP.png" rel="nofollow noreferrer">Picture of results</a></p>