<?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: DAX doing wrong with &amp;quot;not isblank over related fact&amp;quot; filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3449442#M131352</link>
    <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;You can use the following measure&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MinimumAttribute =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MINX&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'D_Entities'&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;RELATEDTABLE&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'F_Comments'&lt;/SPAN&gt;&lt;SPAN&gt; ) ) &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[Attribute]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 27 Sep 2023 09:47:13 GMT</pubDate>
    <dc:creator>nirali_arora</dc:creator>
    <dc:date>2023-09-27T09:47:13Z</dc:date>
    <item>
      <title>DAX doing wrong with "not isblank over related fact" filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3449323#M131347</link>
      <description>&lt;P&gt;In a simple example where we have a dimension D_Entities with each dimension having some numeric Attribute, and a F_Comments table where each dimension might or might not have rows corresponding to it (1-many relationship over Name) - the goal is to calculate minimum Attribute value over all dimemsions that have corresponding rows.&lt;BR /&gt;&lt;BR /&gt;Why on earth a simple measure doesn't work right:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MinAttr =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;D_Entities&lt;/SPAN&gt;&lt;SPAN&gt;[Attribute]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;NOT&lt;/SPAN&gt; &lt;SPAN&gt;ISBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;F_Comments&lt;/SPAN&gt;&lt;SPAN&gt;[Comment]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected result for MinAttr measure is 100 because "A" dimension is the only dimension that has corresponding rows in F_Comments, and it's Attribute value is 100:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's all on the screen, really:&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;</description>
      <pubDate>Wed, 27 Sep 2023 09:00:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3449323#M131347</guid>
      <dc:creator>DmitryKo</dc:creator>
      <dc:date>2023-09-27T09:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: DAX doing wrong with "not isblank over related fact" filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3449442#M131352</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;You can use the following measure&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MinimumAttribute =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MINX&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'D_Entities'&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;RELATEDTABLE&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'F_Comments'&lt;/SPAN&gt;&lt;SPAN&gt; ) ) &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[Attribute]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 27 Sep 2023 09:47:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3449442#M131352</guid>
      <dc:creator>nirali_arora</dc:creator>
      <dc:date>2023-09-27T09:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: DAX doing wrong with "not isblank over related fact" filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3449462#M131353</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="430426" data-lia-user-login="DmitryKo" class="lia-mention lia-mention-user"&gt;DmitryKo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order to retrieve rows of D_Entities for which F_Comments is nonempty, you can use the SUMMARIZE function.&lt;/P&gt;
&lt;P&gt;Here are some variations on how you could do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MinAttr = 
CALCULATE (
    MIN ( D_Entities[Attribute] ),
    SUMMARIZE ( F_Comments, D_Entities[Name] )
    -- Could also use SUMMARIZE ( F_Comments, D_Entities[Number] )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;MinAttr = 
-- SUMMARIZE F_Comments by D_Entities[Attribte]
-- then return the minimum
MINX (
    SUMMARIZE ( F_Comments, D_Entities[Attribute] ),
    D_Entities[Attribute]
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;MinAttr = 
CALCULATE (
    MIN ( D_Entities[Attribute] ),
    F_Comments -- Apply the expanded F_Comments table as a filter
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason for the original unintended result was that a filter on the F_Comments table does not itself filter the D_Entities table, due to the relationship direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suggest reading some articles on expanded tables.&lt;/P&gt;
&lt;P&gt;e.g. &lt;A href="http://mdxdax.blogspot.com/2011/03/logic-behind-magic-of-dax-cross-table.html" target="_blank" rel="noopener"&gt;http://mdxdax.blogspot.com/2011/03/logic-behind-magic-of-dax-cross-table.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;or SQLBI will have some.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 09:57:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3449462#M131353</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2023-09-27T09:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: DAX doing wrong with "not isblank over related fact" filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3449670#M131364</link>
      <description>&lt;P&gt;Guys, thanks for the quick response, and we have at least &lt;STRONG&gt;several solutions that work&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Use the original measure (with ISBLANK), but change D_Entities to F_Comments cross-filter direction to &lt;STRONG&gt;Both&lt;/STRONG&gt;;&lt;/LI&gt;&lt;LI&gt;Use the measure suggested by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="615051" data-lia-user-login="nirali_arora" class="lia-mention lia-mention-user"&gt;nirali_arora&lt;/a&gt;, except for the ALL() part that would remove much-needed context;&lt;/LI&gt;&lt;LI&gt;use SUMMARIZE() approach with essentially intermediate table (that I intentionally omitted due to Occam's razor)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;Aesthetically, I'd take the first option - as it provides clearest code with minimal performance overhead, F_Comments being a relatively small "leaf" table. But maybe I'm wrong about performance here and one of the other options scales better? How to evaluate this?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 11:42:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3449670#M131364</guid>
      <dc:creator>DmitryKo</dc:creator>
      <dc:date>2023-09-27T11:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: DAX doing wrong with "not isblank over related fact" filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3451159#M131471</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="430426" data-lia-user-login="DmitryKo" class="lia-mention lia-mention-user"&gt;DmitryKo&lt;/a&gt;&amp;nbsp;you can use the Server Timings or Query Plan features in &lt;A href="https://daxstudio.org/" target="_self"&gt;DAX Studio&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some sample resources:&lt;/P&gt;
&lt;P&gt;&lt;A title="YouTube: DAX Studio - Query plan and server timings (SQLBI)" href="https://www.youtube.com/watch?v=V_AHYAFuFs8" target="_blank" rel="noopener"&gt;https://www.youtube.com/watch?v=V_AHYAFuFs8&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blog.enterprisedna.co/query-plan-server-timings-in-dax-studio/page/60/" target="_blank" rel="noopener"&gt;Enterprise DNA - Query Plan &amp;amp; Server Timings In DAX Studio&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually your measure is roughly the opposite of the computation being tested in this recent article, so may be an interesting read:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/finding-products-without-sales-by-using-dax/" target="_blank" rel="noopener"&gt;https://www.sqlbi.com/articles/finding-products-without-sales-by-using-dax/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 07:05:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3451159#M131471</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2023-09-28T07:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: DAX doing wrong with "not isblank over related fact" filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3451335#M131481</link>
      <description>&lt;P&gt;Expanding on things said before..&lt;BR /&gt;I would leave the relationship as is, but change the measure to:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MinAttr = CALCULATE(
    MIN(D_Entities[Attribute]),
    F_Comments[Comment],
    CROSSFILTER(D_Entities[Name],F_Comments[Name],Both)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Sep 2023 08:30:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-doing-wrong-with-quot-not-isblank-over-related-fact-quot/m-p/3451335#M131481</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-28T08:30:40Z</dc:date>
    </item>
  </channel>
</rss>

