<?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 Re: YTD average time - reset each year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-average-time-reset-each-year/m-p/2423952#M64313</link>
    <description>&lt;P&gt;You are comparing the year of the response time to today, not to the date from your calendar table. Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YTD_Average Time =
var maxDate = MAX ( 'Calendar'[Date] )
CALCULATE (
    AVERAGE ( COMPLAINTS[RESPONSE_TIME] );
    COMPLAINTS[RESPONSE_TIME] &amp;lt;&amp;gt; BLANK ();
    FILTER (
        VALUES ( COMPLAINTS[RESPONSE_TIME] );
        COMPLAINTS[RESPONSE_TIME] &amp;lt; maxDate
    );
    YEAR ( COMPLAINTS[RESPONSE_TIME] ) = YEAR ( maxDate )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 29 Mar 2022 10:26:34 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2022-03-29T10:26:34Z</dc:date>
    <item>
      <title>YTD average time - reset each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-average-time-reset-each-year/m-p/2423787#M64309</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a line chart with a daily average response time and a YTD average response time, but I need to reset this YTD average time when the year changes. Is this possible?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure that I'm using is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;YTD_Average Time = CALCULATE(AVERAGE(COMPLAINTS[RESPONSE_TIME]); COMPLAINTS[RESPONSE_TIME]&amp;lt;&amp;gt;BLANK(); FILTER(VALUES(COMPLAINTS[RESPONSE_TIME]); COMPLAINTS[RESPONSE_TIME] &amp;lt; MAX('Calendar'[Date]));YEAR(COMPLAINTS[RESPONSE_TIME])&amp;lt;=year(today()))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The chart is as following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The blue line is the YTD average response time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do I need to change in the measure for it reset for 2022?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Jorge&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 09:43:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-average-time-reset-each-year/m-p/2423787#M64309</guid>
      <dc:creator>jorge_oliveira</dc:creator>
      <dc:date>2022-03-29T09:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: YTD average time - reset each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-average-time-reset-each-year/m-p/2423952#M64313</link>
      <description>&lt;P&gt;You are comparing the year of the response time to today, not to the date from your calendar table. Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YTD_Average Time =
var maxDate = MAX ( 'Calendar'[Date] )
CALCULATE (
    AVERAGE ( COMPLAINTS[RESPONSE_TIME] );
    COMPLAINTS[RESPONSE_TIME] &amp;lt;&amp;gt; BLANK ();
    FILTER (
        VALUES ( COMPLAINTS[RESPONSE_TIME] );
        COMPLAINTS[RESPONSE_TIME] &amp;lt; maxDate
    );
    YEAR ( COMPLAINTS[RESPONSE_TIME] ) = YEAR ( maxDate )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Mar 2022 10:26:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-average-time-reset-each-year/m-p/2423952#M64313</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-03-29T10:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: YTD average time - reset each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-average-time-reset-each-year/m-p/2433268#M64868</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="218530" data-lia-user-login="jorge_oliveira" class="lia-mention lia-mention-user"&gt;jorge_oliveira&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need another Measure to help you with that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;YTD_Reset_Year =
CALCULATE (
    [YTD_Average Time],
    FILTER (
        'Calendar',
        YEAR ( 'Calendar'[Date] ) = SELECTEDVALUE ( 'Calendar'[Year] ) 
        //If you just need the YTD of 2022, please replace SELECTEDVALUE part with 2022
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then the result will look like this.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider&lt;STRONG&gt; Accept it as the solution&lt;/STRONG&gt; to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _ Caiyun&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 03:05:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-average-time-reset-each-year/m-p/2433268#M64868</guid>
      <dc:creator>v-cazheng-msft</dc:creator>
      <dc:date>2022-04-04T03:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: YTD average time - reset each year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-average-time-reset-each-year/m-p/2773363#M86432</link>
      <description>&lt;P&gt;Thanks to all the users who heldped me. I'm sorry for the delay, but I've been away for some time. Back now.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jorge Oliveira&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 11:39:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-average-time-reset-each-year/m-p/2773363#M86432</guid>
      <dc:creator>jorge_oliveira</dc:creator>
      <dc:date>2022-09-16T11:39:36Z</dc:date>
    </item>
  </channel>
</rss>

