<?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 Understand Nested Calculate dax Code in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Understand-Nested-Calculate-dax-Code/m-p/4373291#M173620</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am exploring nested calculate dax, out of this dax I was expecting only Audio Sales to be displayed but the filter context on Product Category is retained in Measure Calculates measures. Please may I have help understand what I am missing.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DataModel:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 09:48:22 GMT</pubDate>
    <dc:creator>han_rj</dc:creator>
    <dc:date>2025-01-21T09:48:22Z</dc:date>
    <item>
      <title>Understand Nested Calculate dax Code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Understand-Nested-Calculate-dax-Code/m-p/4373291#M173620</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am exploring nested calculate dax, out of this dax I was expecting only Audio Sales to be displayed but the filter context on Product Category is retained in Measure Calculates measures. Please may I have help understand what I am missing.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DataModel:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 09:48:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Understand-Nested-Calculate-dax-Code/m-p/4373291#M173620</guid>
      <dc:creator>han_rj</dc:creator>
      <dc:date>2025-01-21T09:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Understand Nested Calculate dax Code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Understand-Nested-Calculate-dax-Code/m-p/4373306#M173621</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="702570" data-lia-user-login="han_rj" class="lia-mention lia-mention-user"&gt;han_rj&lt;/a&gt;&amp;nbsp;The issue with your DAX formula is that the nested CALCULATE function does not work as expected because the inner CALCULATE does not return a scalar value that can be used in the outer CALCULATE&lt;/P&gt;
&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;Measures = &lt;BR /&gt;VAR calc = CALCULATE([Sales Amount], 'Product Category'[Category] = "Audio")&lt;BR /&gt;RETURN calc&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 09:28:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Understand-Nested-Calculate-dax-Code/m-p/4373306#M173621</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-01-21T09:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Understand Nested Calculate dax Code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Understand-Nested-Calculate-dax-Code/m-p/4373471#M173628</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="702570" data-lia-user-login="han_rj" class="lia-mention lia-mention-user"&gt;han_rj&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;why you are using variable? variable scope is limited..&lt;BR /&gt;Just use &lt;SPAN&gt;CALCULATE([Sales Amount], 'Product Category'[Category] = "Audio")&lt;/SPAN&gt;&lt;BR /&gt;Or&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;CALCULATE([Sales Amount],FILTER(ALL(&amp;nbsp;'Product Category'[Category] ),'Product Category'[Category] = "Audio") )&lt;BR /&gt;&lt;/SPAN&gt;This is not the case of nested calculate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;sanalytics&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 10:45:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Understand-Nested-Calculate-dax-Code/m-p/4373471#M173628</guid>
      <dc:creator>sanalytics</dc:creator>
      <dc:date>2025-01-21T10:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Understand Nested Calculate dax Code</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Understand-Nested-Calculate-dax-Code/m-p/4373480#M173630</link>
      <description>&lt;P&gt;Variables in DAX are not really variable, they are constants. They are only ever evaluated once, and then they do not change. So your calc variable is evaluated in the original filter context, and the subsequent CALCULATE has no effect on that.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 10:54:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Understand-Nested-Calculate-dax-Code/m-p/4373480#M173630</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-01-21T10:54:29Z</dc:date>
    </item>
  </channel>
</rss>

