<?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: Cumulative measure with both active and inactive relationships in use in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-measure-with-both-active-and-inactive-relationships/m-p/2309428#M57364</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I think by removing the FILTER in your first cumulative calculation there shouldn't be any issues. If there are try using CROSSFILTER to make sure there isn't any cyclic references.&lt;BR /&gt;&lt;BR /&gt;I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;My LinkedIn: &lt;A href="https://www.linkedin.com/in/n%C3%A4ttiahov-00001/" target="_blank"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 30 Jan 2022 14:41:33 GMT</pubDate>
    <dc:creator>ValtteriN</dc:creator>
    <dc:date>2022-01-30T14:41:33Z</dc:date>
    <item>
      <title>Cumulative measure with both active and inactive relationships in use</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-measure-with-both-active-and-inactive-relationships/m-p/2309373#M57358</link>
      <description>&lt;P&gt;I'm having trouble creating a cumulative sum with both direct and indirect relationships in play.&amp;nbsp; Simplified data structure is as shown - direct relationships between DateTable&amp;lt;--&amp;gt;Invoices and Invoices &amp;lt;--&amp;gt; Payments, then an inactive relationship between Payments &amp;lt;--&amp;gt; DateTable&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;I have a report level filter on InvoiceDate, to only show data for invoices issued within a certain period (in this case, year), then a matrix of payments per period. This uses the following measure, which works as intended:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Payments = CALCULATE(SUM([Payment Amount]),USERELATIONSHIP(DateTable[Date],Payments[PaymentDate]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I can't figure out the cumulative total - I've tried the following. I've seen suggestions to nest CALCULATE statements, which I think the [Payments] measure is already doing, but I've also copied that calculation in place of the measure, to no effect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cumulative Payments = CALCULATE([Payments],FILTER(ALLSELECTED(DateTable),DateTable[Date]&amp;lt;=MAX(DateTable[Date])))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cumulative Payments = CALCULATE([Payments],FILTER(ALLSELECTED(DateTable),DateTable[Date]&amp;lt;=MAX(DateTable[Date])),USERELATIONSHIP(DateTable[Date],Invoices[InvoiceDate]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cumulative Payments = CALCULATE(CALCULATE(SUM([Payment Amount]),USERELATIONSHIP(DateTable[Date],Payments[PaymentDate])),FILTER(ALLSELECTED(DateTable),DateTable[Date]&amp;lt;=MAX(DateTable[Date])),USERELATIONSHIP(DateTable[Date],Invoices[InvoiceDate]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas gratefully received!&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jan 2022 12:53:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-measure-with-both-active-and-inactive-relationships/m-p/2309373#M57358</guid>
      <dc:creator>marine_adz</dc:creator>
      <dc:date>2022-01-30T12:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative measure with both active and inactive relationships in use</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-measure-with-both-active-and-inactive-relationships/m-p/2309428#M57364</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I think by removing the FILTER in your first cumulative calculation there shouldn't be any issues. If there are try using CROSSFILTER to make sure there isn't any cyclic references.&lt;BR /&gt;&lt;BR /&gt;I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;My LinkedIn: &lt;A href="https://www.linkedin.com/in/n%C3%A4ttiahov-00001/" target="_blank"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jan 2022 14:41:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-measure-with-both-active-and-inactive-relationships/m-p/2309428#M57364</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-01-30T14:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative measure with both active and inactive relationships in use</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-measure-with-both-active-and-inactive-relationships/m-p/2312468#M57527</link>
      <description>&lt;P&gt;Thanks for replying - without the filter, isn't it just the original measure without being cumulative?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure there will be a way around this through DAX, but I managed to solve it much more simply - created another table (DateTablePayment = 'DateTable'), removed the inactive relationship and added a new active relationship between Payments[PaymentDate] and DateTablePayment[Date]&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 08:29:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-measure-with-both-active-and-inactive-relationships/m-p/2312468#M57527</guid>
      <dc:creator>marine_adz</dc:creator>
      <dc:date>2022-02-01T08:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative measure with both active and inactive relationships in use</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-measure-with-both-active-and-inactive-relationships/m-p/2312482#M57530</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="355519" data-lia-user-login="marine_adz" class="lia-mention lia-mention-user"&gt;marine_adz&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I meant removing the FILTER and its corresponding () signs. The basic pattern for RT calculation is like this:&lt;BR /&gt;var maxdate = MAX('Calendar'[Date])&lt;BR /&gt;CALCULATE(SUM(Table[Value]),ALL(Calendar),Calendar[Date]&amp;lt;=maxdate)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 08:36:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-measure-with-both-active-and-inactive-relationships/m-p/2312482#M57530</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-02-01T08:36:29Z</dc:date>
    </item>
  </channel>
</rss>

