<?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 - Direct Query to AAS in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-Dependency-error-Direct-Query-to-AAS/m-p/3279250#M121759</link>
    <description>&lt;P&gt;The problem is that RELATEDTABLE is rewritten internally to CALCULATETABLE and it uses all columns from the expanded dimension table as filters. When you try to add new calculated columns they are added to the table and it will try to use them as filters as well, hence the circular dependency.&lt;/P&gt;
&lt;P&gt;You need to remove the filters on all columns in the table except the key column used in the relationship between your dimension table and fact table, e.g.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Call Log Duration =
VAR _A =
    MINX (
        CALCULATETABLE (
            'Call Logs Ameyo',
            ALLEXCEPT ( 'Calling List Dimension', 'Calling List Dimension'[Key column] )
        ),
        'Call Logs Ameyo'[CH_DATE_ADDED]
    )
VAR _C =
    DATEDIFF ( 'Calling List Dimension'[CREATEDATE], _A, HOUR )
RETURN
    _C
&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 12 Jun 2023 10:32:16 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2023-06-12T10:32:16Z</dc:date>
    <item>
      <title>Circular Dependency error - Direct Query to AAS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-Dependency-error-Direct-Query-to-AAS/m-p/3268313#M121055</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create 2 Calculated columns : -&lt;BR /&gt;Column 1 :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Call Log Duration = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; _A =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MINX&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;RELATEDTABLE&lt;/SPAN&gt;&lt;SPAN&gt; ( 'Call Logs Ameyo' ), 'Call Logs Ameyo'[CH_DATE_ADDED] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; _C =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt; ( 'Calling List Dimension'[CREATEDATE], _A, HOUR )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_C&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;For Column 1, I have taken earliest date from my fact table using minx( ) and relatedtable( ) function and created a calculated column in my Dimension table.&lt;BR /&gt;&lt;BR /&gt;The issue is when create one more calculated colulmn referring to this Calculated column (Column 1) like a calculated column with IF condition on Column 1, I am getting circular dependency error.&amp;nbsp;&lt;BR /&gt;Error msg&amp;nbsp; : "A circular dependency was detected: Calling List Dimension[Call Log Duration], Calling List Dimension[TAT Bucket], Calling List Dimension[Call Log Duration]."&lt;BR /&gt;&lt;BR /&gt;How to resolve this error and create this new calculated column.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks in advance !!!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Column 2&amp;nbsp; :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 05 Jun 2023 11:23:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-Dependency-error-Direct-Query-to-AAS/m-p/3268313#M121055</guid>
      <dc:creator>AswinSuresh</dc:creator>
      <dc:date>2023-06-05T11:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Circular Dependency error - Direct Query to AAS</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-Dependency-error-Direct-Query-to-AAS/m-p/3279250#M121759</link>
      <description>&lt;P&gt;The problem is that RELATEDTABLE is rewritten internally to CALCULATETABLE and it uses all columns from the expanded dimension table as filters. When you try to add new calculated columns they are added to the table and it will try to use them as filters as well, hence the circular dependency.&lt;/P&gt;
&lt;P&gt;You need to remove the filters on all columns in the table except the key column used in the relationship between your dimension table and fact table, e.g.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Call Log Duration =
VAR _A =
    MINX (
        CALCULATETABLE (
            'Call Logs Ameyo',
            ALLEXCEPT ( 'Calling List Dimension', 'Calling List Dimension'[Key column] )
        ),
        'Call Logs Ameyo'[CH_DATE_ADDED]
    )
VAR _C =
    DATEDIFF ( 'Calling List Dimension'[CREATEDATE], _A, HOUR )
RETURN
    _C
&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 12 Jun 2023 10:32:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Circular-Dependency-error-Direct-Query-to-AAS/m-p/3279250#M121759</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-06-12T10:32:16Z</dc:date>
    </item>
  </channel>
</rss>

