<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic YTD difference between 2 dates in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-difference-between-2-dates/m-p/1223978#M19898</link>
    <description>&lt;P&gt;Dear All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just trying to create a line chart by week that shows a punctual difference between 2 dates and the related YTD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the punctual calculation we succeed using also an holiday calendar. Here below the Dax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ricevimento odv - inserimento CO = 
VAR Ricevimento = MAX('2019'[Data ricevimento odv])
VAR Inserimento = MAX('2019'[Data documento])
RETURN CALCULATE(SUM('CALENDAR'[is work day]),
FILTER(ALL('CALENDAR'[Solar Date]),
'CALENDAR'[Solar Date] &amp;gt;= Ricevimento
&amp;amp;&amp;amp; 'CALENDAR'[Solar Date] &amp;lt;=Inserimento))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that the cumulated is not working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ricevimento Odv - invio CO cumulated = calculate([Ricevimento odv - invio CO],filter(ALLSELECTED('Calendar'),'CALENDAR'[Solar Date]&amp;lt;=MAX('2019'[Data ricevimento odv])))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here below the relationship between tables and the graph that is not working (the red line)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Any idea?!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Zeno&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jul 2020 08:27:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-15T08:27:28Z</dc:date>
    <item>
      <title>YTD difference between 2 dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-difference-between-2-dates/m-p/1223978#M19898</link>
      <description>&lt;P&gt;Dear All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm just trying to create a line chart by week that shows a punctual difference between 2 dates and the related YTD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the punctual calculation we succeed using also an holiday calendar. Here below the Dax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ricevimento odv - inserimento CO = 
VAR Ricevimento = MAX('2019'[Data ricevimento odv])
VAR Inserimento = MAX('2019'[Data documento])
RETURN CALCULATE(SUM('CALENDAR'[is work day]),
FILTER(ALL('CALENDAR'[Solar Date]),
'CALENDAR'[Solar Date] &amp;gt;= Ricevimento
&amp;amp;&amp;amp; 'CALENDAR'[Solar Date] &amp;lt;=Inserimento))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that the cumulated is not working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Ricevimento Odv - invio CO cumulated = calculate([Ricevimento odv - invio CO],filter(ALLSELECTED('Calendar'),'CALENDAR'[Solar Date]&amp;lt;=MAX('2019'[Data ricevimento odv])))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here below the relationship between tables and the graph that is not working (the red line)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Any idea?!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Zeno&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 08:27:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-difference-between-2-dates/m-p/1223978#M19898</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-15T08:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: YTD difference between 2 dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-difference-between-2-dates/m-p/1224084#M19900</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , have tried using use relation with datesytd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;like this example&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;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]))&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Jul 2020 08:59:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-difference-between-2-dates/m-p/1224084#M19900</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-15T08:59:26Z</dc:date>
    </item>
  </channel>
</rss>

