<?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 Problems with Calculate and DATESBETWEEN for Rolling calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2171228#M50420</link>
    <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate a 12 month cummulative sum of some values. I am using the formula:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf0"&gt;=&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf1"&gt;sum&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;([WON]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf1"&gt;DATESBETWEEN&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;(Table1[date];&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf1"&gt;dateadd&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;(Table1[date];-1;&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;YEAR&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf0"&gt;Table1[date]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where fecha is a Date formated column in my dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's not working; datesbetween function doesn't seem to filter the dates and only retieves the same value all the time. Dateadd does work and refer to the Y-1 date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried this same formula in other dataset and it seems to do the trick. I've checked the date format in case it was a regional configuration issue and doesn't seem to be a problem.&amp;nbsp;What can be wrong? I am getting the data via MySQL connector service but it shouldn't be a problem, should it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll appreciate any help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Javier&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Nov 2021 17:57:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-11-03T17:57:34Z</dc:date>
    <item>
      <title>Problems with Calculate and DATESBETWEEN for Rolling calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2171228#M50420</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate a 12 month cummulative sum of some values. I am using the formula:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--  StartFragment   --&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf0"&gt;=&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf1"&gt;sum&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;([WON]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf1"&gt;DATESBETWEEN&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;(Table1[date];&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf1"&gt;dateadd&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;(Table1[date];-1;&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;YEAR&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf0"&gt;Table1[date]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where fecha is a Date formated column in my dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's not working; datesbetween function doesn't seem to filter the dates and only retieves the same value all the time. Dateadd does work and refer to the Y-1 date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried this same formula in other dataset and it seems to do the trick. I've checked the date format in case it was a regional configuration issue and doesn't seem to be a problem.&amp;nbsp;What can be wrong? I am getting the data via MySQL connector service but it shouldn't be a problem, should it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll appreciate any help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Javier&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 17:57:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2171228#M50420</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-03T17:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with Calculate and DATESBETWEEN for Rolling calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2176060#M50610</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/datesinperiod-function-dax" target="_blank"&gt;DATESINPERIOD&lt;/A&gt; DAX function rather than&amp;nbsp;&lt;SPAN&gt;DATESBETWEEN.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf0"&gt;=&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf1"&gt;sum&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;([WON]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf0"&gt;&lt;SPAN class="hljs-built_in"&gt;DATESINPERIOD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;Table1[date];&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf0"&gt;MAX(Table1[date]);-1;&lt;/SPAN&gt;&lt;SPAN class="cf1"&gt;YEAR&lt;/SPAN&gt;&lt;SPAN class="cf0"&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf0"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="cf0"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Nov 2021 22:43:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2176060#M50610</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-11-06T22:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with Calculate and DATESBETWEEN for Rolling calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2178550#M50681</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now it seems to show a circular dependence error. How can this be?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 16:30:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2178550#M50681</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-08T16:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with Calculate and DATESBETWEEN for Rolling calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2178615#M50683</link>
      <description>&lt;P&gt;It worked as a variable, thouhgh not in a row level. Will try some iterator functions!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 17:04:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2178615#M50683</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-08T17:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with Calculate and DATESBETWEEN for Rolling calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2179034#M50692</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share a sample of your file [PBIX] after emoving sensetive data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 23:15:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2179034#M50692</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-11-08T23:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with Calculate and DATESBETWEEN for Rolling calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2182347#M50815</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For any time intelligence function, you could implement a custom DAX formula.&lt;/P&gt;
&lt;P&gt;&lt;A title="" href="https://www.sqlbi.com/articles/time-intelligence-in-power-bi-desktop/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.sqlbi.com/articles/time-intelligence-in-power-bi-desktop/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To avoid&amp;nbsp;circular dependency error, see post below as an example.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Can-t-link-2-columns-one-of-which-is-calculated/m-p/351000#M157793" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Can-t-link-2-columns-one-of-which-is-calculated/m-p/351000#M157793&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 09:13:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problems-with-Calculate-and-DATESBETWEEN-for-Rolling-calculation/m-p/2182347#M50815</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2021-11-10T09:13:17Z</dc:date>
    </item>
  </channel>
</rss>

