<?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 Circular dependency - looking for suggestions in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-dependency-looking-for-suggestions/m-p/4122622#M163684</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I built in Excel a model that I wish to replicate in DAX.&lt;/P&gt;&lt;P&gt;the problem is that I get Circular depedency in DAX.&lt;/P&gt;&lt;P&gt;In Excel I do not get errors because the forumlas use Index and level to calculate in a given order, for instance:&lt;/P&gt;&lt;PRE&gt;Requirement from Above=IF([@Level]=0,[@Qty],SUMIFS([Missing Qty],[Material],[@[Father Above]],[Index],[@Index],[Level],"&amp;lt;"&amp;amp;[@Level]))&lt;/PRE&gt;&lt;PRE&gt;Stock available=MAX(0,[@Stock]-SUMIFS([Consumption],[Material],[@Material],[Index],"&amp;lt;"&amp;amp;[@Index]))&lt;/PRE&gt;&lt;P&gt;Consumption is the difference between those two fields, and missing Qty is requirement- consumption.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve it in DAX?&lt;/P&gt;&lt;P&gt;clearly, it returns error as soon as two fields are linked to each other, ignoring the fact the formula structure avoids dependency at the same level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2024 11:07:45 GMT</pubDate>
    <dc:creator>MagikJukas</dc:creator>
    <dc:date>2024-08-28T11:07:45Z</dc:date>
    <item>
      <title>Circular dependency - looking for suggestions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-dependency-looking-for-suggestions/m-p/4122622#M163684</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I built in Excel a model that I wish to replicate in DAX.&lt;/P&gt;&lt;P&gt;the problem is that I get Circular depedency in DAX.&lt;/P&gt;&lt;P&gt;In Excel I do not get errors because the forumlas use Index and level to calculate in a given order, for instance:&lt;/P&gt;&lt;PRE&gt;Requirement from Above=IF([@Level]=0,[@Qty],SUMIFS([Missing Qty],[Material],[@[Father Above]],[Index],[@Index],[Level],"&amp;lt;"&amp;amp;[@Level]))&lt;/PRE&gt;&lt;PRE&gt;Stock available=MAX(0,[@Stock]-SUMIFS([Consumption],[Material],[@Material],[Index],"&amp;lt;"&amp;amp;[@Index]))&lt;/PRE&gt;&lt;P&gt;Consumption is the difference between those two fields, and missing Qty is requirement- consumption.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve it in DAX?&lt;/P&gt;&lt;P&gt;clearly, it returns error as soon as two fields are linked to each other, ignoring the fact the formula structure avoids dependency at the same level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 11:07:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-dependency-looking-for-suggestions/m-p/4122622#M163684</guid>
      <dc:creator>MagikJukas</dc:creator>
      <dc:date>2024-08-28T11:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Circular dependency - looking for suggestions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-dependency-looking-for-suggestions/m-p/4122796#M163692</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="362433" data-lia-user-login="MagikJukas" class="lia-mention lia-mention-user"&gt;MagikJukas&lt;/a&gt;&amp;nbsp;Instead of using SUMIFS, you can use DAX functions like SUMX or FILTER to iterate over tables and perform calculations.&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;RequirementFromAbove = &lt;BR /&gt;IF (&lt;BR /&gt;Table[Level] = 0,&lt;BR /&gt;Table[Qty],&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( Table[MissingQty] ),&lt;BR /&gt;FILTER (&lt;BR /&gt;Table,&lt;BR /&gt;Table[Material] = EARLIER ( Table[FatherAbove] ) &amp;amp;&amp;amp;&lt;BR /&gt;Table[Index] = EARLIER ( Table[Index] ) &amp;amp;&amp;amp;&lt;BR /&gt;Table[Level] &amp;lt; EARLIER ( Table[Level] )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;StockAvailable = &lt;BR /&gt;MAX (&lt;BR /&gt;0,&lt;BR /&gt;Table[Stock] - &lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( Table[Consumption] ),&lt;BR /&gt;FILTER (&lt;BR /&gt;Table,&lt;BR /&gt;Table[Material] = EARLIER ( Table[Material] ) &amp;amp;&amp;amp;&lt;BR /&gt;Table[Index] &amp;lt; EARLIER ( Table[Index] )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consumption = Table[RequirementFromAbove] - Table[StockAvailable]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MissingQty = Table[RequirementFromAbove] - Table[Consumption]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 12:38:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-dependency-looking-for-suggestions/m-p/4122796#M163692</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2024-08-28T12:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Circular dependency - looking for suggestions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-dependency-looking-for-suggestions/m-p/4123022#M163707</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;thanks for your solution. the problem is that it creates a dependency with among the 4 column.&lt;/P&gt;&lt;P&gt;In Excel you can fix it by writing to sum the values earlier. In DAX it does not work. as soon two column have a potential dependency, you cannot calculate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to understand if there are tricks to work around this problem.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 14:24:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-dependency-looking-for-suggestions/m-p/4123022#M163707</guid>
      <dc:creator>MagikJukas</dc:creator>
      <dc:date>2024-08-28T14:24:01Z</dc:date>
    </item>
  </channel>
</rss>

