<?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: RELATED () function error in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RELATED-function-error/m-p/3076825#M107007</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="513014" data-lia-user-login="MarkKemeny" class="lia-mention lia-mention-user"&gt;MarkKemeny&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try the following methods&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;BR /&gt;Sample data:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;One to many&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
CALCULATE ( COUNTROWS ( 'fct_Overview_Status_Phase_1-2-3_Promotion' ),
    FILTER ( ALL ( 'fct_Overview_Status_Phase_1-2-3_Promotion' ),
        'fct_Overview_Status_Phase_1-2-3_Promotion'[Date.1]
            &amp;lt; SELECTEDVALUE ( dim_Deadlines[Deadline] )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Feb 2023 02:21:55 GMT</pubDate>
    <dc:creator>v-zhangti</dc:creator>
    <dc:date>2023-02-13T02:21:55Z</dc:date>
    <item>
      <title>RELATED () function error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RELATED-function-error/m-p/3074984#M106887</link>
      <description>&lt;P&gt;Hi Guys,&lt;BR /&gt;I have a problem with the RELATED() funcion in dax.&lt;BR /&gt;I have a simple dimension and fact table where I have to compare date values in the fact table with the values in the dimension table:&lt;BR /&gt;CALCULATE(COUNTROWS('fct_Overview_Status_Phase_1-2-3_Promotion'), 'fct_Overview_Status_Phase_1-2-3_Promotion'[Date.1]&amp;lt;RELATED(dim_Deadlines[Deadline])).&lt;BR /&gt;It gives me the error that "The column 'dim_Deadlines[Deadline]' either doesn't exist or doesn't have a relationship to any table available in the current context."&lt;/P&gt;&lt;P&gt;The two tables are connected with a 1 to many relationship so I dont understand what is the problem.&lt;BR /&gt;When I create a conditional column in the fact table using the RELATED() function it works fine, but when I am using that inside a DAX measure it gives me this error.&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Mark&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 16:01:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RELATED-function-error/m-p/3074984#M106887</guid>
      <dc:creator>MarkKemeny</dc:creator>
      <dc:date>2023-02-10T16:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: RELATED () function error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RELATED-function-error/m-p/3075037#M106893</link>
      <description>&lt;P&gt;At the point where you are using RELATED no row context exists, so it cannot traverse the relationship. I think you want something like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;My Measure =
VAR MaxDate =
    MAX ( dim_Deadlines[Deadline] )
RETURN
    CALCULATE (
        COUNTROWS ( 'fct_Overview_Status_Phase_1-2-3_Promotion' ),
        'fct_Overview_Status_Phase_1-2-3_Promotion'[Date.1] &amp;lt; MaxDate
    )
&lt;/LI-CODE&gt;
&lt;P&gt;As long as some column from your dimension table is in the visual this should work.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 16:18:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RELATED-function-error/m-p/3075037#M106893</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-02-10T16:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: RELATED () function error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RELATED-function-error/m-p/3076825#M107007</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="513014" data-lia-user-login="MarkKemeny" class="lia-mention lia-mention-user"&gt;MarkKemeny&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try the following methods&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;BR /&gt;Sample data:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;One to many&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
CALCULATE ( COUNTROWS ( 'fct_Overview_Status_Phase_1-2-3_Promotion' ),
    FILTER ( ALL ( 'fct_Overview_Status_Phase_1-2-3_Promotion' ),
        'fct_Overview_Status_Phase_1-2-3_Promotion'[Date.1]
            &amp;lt; SELECTEDVALUE ( dim_Deadlines[Deadline] )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 02:21:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RELATED-function-error/m-p/3076825#M107007</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2023-02-13T02:21:55Z</dc:date>
    </item>
  </channel>
</rss>

