<?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 Power bi calculate sum taking into account the expiry date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3299937#M123048</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataday and an expiry date column for a year, each dataday has an expiry date and a unit value.&lt;/P&gt;&lt;P&gt;How can I calculate a cumulative amount for the unit values, so that the calculation skips the datadays and unit values with an earlier expiry date than the dataday?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, there is an expiry date of 20 June for a 20 June dataday and therefore I don't want it to be included in the cumulative amount of 21 June.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2023 13:59:52 GMT</pubDate>
    <dc:creator>streli</dc:creator>
    <dc:date>2023-06-23T13:59:52Z</dc:date>
    <item>
      <title>Power bi calculate sum taking into account the expiry date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3299937#M123048</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataday and an expiry date column for a year, each dataday has an expiry date and a unit value.&lt;/P&gt;&lt;P&gt;How can I calculate a cumulative amount for the unit values, so that the calculation skips the datadays and unit values with an earlier expiry date than the dataday?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, there is an expiry date of 20 June for a 20 June dataday and therefore I don't want it to be included in the cumulative amount of 21 June.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 13:59:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3299937#M123048</guid>
      <dc:creator>streli</dc:creator>
      <dc:date>2023-06-23T13:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Power bi calculate sum taking into account the expiry date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3300425#M123078</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="578509" data-lia-user-login="streli" class="lia-mention lia-mention-user"&gt;streli&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cumulative Amount =
VAR CurrentDate = 'Table'[dataday]
RETURN
    CALCULATE(
        SUM('Table'[unit value]),
        'Table'[expiry date] &amp;gt;= CurrentDate
    )&lt;/LI-CODE&gt;&lt;P&gt;Do not hesitate to let me know if you might need further assistance.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 20:36:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3300425#M123078</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2023-06-23T20:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Power bi calculate sum taking into account the expiry date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3300762#M123102</link>
      <description>&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;thank you very much for your reply!&lt;/P&gt;&lt;P&gt;unfortunately after VAR it does not recognize the DataDay field in the data table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you have any more ideas?&lt;/P&gt;&lt;P&gt;thank you very much&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2023 14:29:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3300762#M123102</guid>
      <dc:creator>streli</dc:creator>
      <dc:date>2023-06-24T14:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Power bi calculate sum taking into account the expiry date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3307597#M123549</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="578509" data-lia-user-login="streli" class="lia-mention lia-mention-user"&gt;streli&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Amount Cumulative = SUMX(FILTER(ALL(data),[DataDay]&amp;lt;=SELECTEDVALUE(data[DataDay])&amp;amp;&amp;amp;[ExpiryDay]&amp;gt;=SELECTEDVALUE(data[DataDay])),[Volumen])&lt;/LI-CODE&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 07:02:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3307597#M123549</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2023-06-29T07:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Power bi calculate sum taking into account the expiry date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3307865#M123561</link>
      <description>&lt;P&gt;Hi Jianbo Li, very good, thank you very much for you reply, it works!!!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 08:55:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-bi-calculate-sum-taking-into-account-the-expiry-date/m-p/3307865#M123561</guid>
      <dc:creator>streli</dc:creator>
      <dc:date>2023-06-29T08:55:45Z</dc:date>
    </item>
  </channel>
</rss>

