<?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: Circular Dependency Error for Calculate in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-Dependency-Error-for-Calculate/m-p/2668330#M79478</link>
    <description>&lt;P&gt;If possible, push the calculated columns computation further upstream (into Power Query or the data source). That will avoid the circular reference issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same for the DateDim - don't do that in DAX, do it in Power Query or further upstream.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jul 2022 00:31:42 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2022-07-29T00:31:42Z</dc:date>
    <item>
      <title>Circular Dependency Error for Calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-Dependency-Error-for-Calculate/m-p/2665093#M79169</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;Need help to fix circular dependency in order to get the final date&lt;/P&gt;&lt;P&gt;In calculations, need to average and then find how much time is required for completion based on last 2 months average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Columns&lt;/STRONG&gt; - Status ( there are 2 status - completed and pending) ,project, points, closingdate, work_left&lt;/P&gt;&lt;P&gt;[points] are at [mainkey_id] level and rolled up to project level&lt;/P&gt;&lt;P&gt;work_left is sum of points at [mainkey_id] level with [status] as pending&amp;nbsp;&lt;/P&gt;&lt;P&gt;DateDim is calculatedtable having all dates and joined with closingdate from Query1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;based on completed status for last 2 months we add the points per project and take an average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[AvgWorkDone] =&lt;/P&gt;&lt;P&gt;IF(ISBLANK(CALCULATE(SUM('Query1'[points]),DATESBETWEEN(DateDim[Date],TODAY()-60, TODAY()) , ALLEXCEPT('Query1','Query1'[mainkey_id]))/2 ),0,CALCULATE(SUM('Query1'[points]),DATESBETWEEN(DateDim[Date],TODAY()-60, TODAY()) , ALLEXCEPT('Query1','Query1'[mainkey_id]))/2 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The report has to show all data so we have data pulled for last 2 years and for computing final date we need to consider only last 2 months average.&lt;/P&gt;&lt;DIV&gt;we get the correct average and even if we take the ratio of this average based on the work pending we get the right result in a measure. Calculated Column does not show the right result.&lt;/DIV&gt;&lt;P&gt;This still works fine, but the calculated number of days are to be added in today's date so using DateAdd get circular dependency. Tried using ALLEXCEPT but nothing works..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to calculate the final date ---&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE&lt;BR /&gt;(&lt;/P&gt;&lt;P&gt;DATEADD(&lt;BR /&gt;Query1[DateToday],&lt;BR /&gt;DIVIDE(&lt;BR /&gt;SUM(Query1[work_left]),&lt;BR /&gt;CALCULATE(SUM(Query1[AvgWorkDone]),ALLEXCEPT(Query1,Query1[mainkey_id]))&lt;BR /&gt;,0)&lt;BR /&gt;,DAY)&lt;BR /&gt;,ALLEXCEPT(Query1,Query1[[mainkey_id])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;not sure what needs to be changed or calculated differently. Any help much appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 13:19:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-Dependency-Error-for-Calculate/m-p/2665093#M79169</guid>
      <dc:creator>Charuta</dc:creator>
      <dc:date>2022-07-27T13:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Circular Dependency Error for Calculate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-Dependency-Error-for-Calculate/m-p/2668330#M79478</link>
      <description>&lt;P&gt;If possible, push the calculated columns computation further upstream (into Power Query or the data source). That will avoid the circular reference issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same for the DateDim - don't do that in DAX, do it in Power Query or further upstream.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 00:31:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-Dependency-Error-for-Calculate/m-p/2668330#M79478</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-07-29T00:31:42Z</dc:date>
    </item>
  </channel>
</rss>

