<?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 Calculate Function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculate-Function/m-p/2857313#M91888</link>
    <description>&lt;P&gt;Variables are not variable, they are constant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You cannot alter the value of a variable once it has been assigned. Therefore this line of code does not change the value of the variable&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var all_sales = calculate(&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;current_sales&lt;/FONT&gt;&lt;SPAN&gt;,all('Product Category'[Category]))&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Oct 2022 08:30:31 GMT</pubDate>
    <dc:creator>MattAllington</dc:creator>
    <dc:date>2022-10-23T08:30:31Z</dc:date>
    <item>
      <title>Dax Calculate Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculate-Function/m-p/2857311#M91887</link>
      <description>&lt;P&gt;I have been wrestling to understand how logically the following to statements or (measures) are providing different results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Sales PCT_1 =&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; var &lt;FONT color="#0000FF"&gt;current_sales&lt;/FONT&gt; = sumx(sales, Sales[Quantity]*Sales[Net Price])&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; var all_sales = calculate(&lt;FONT color="#0000FF"&gt;current_sales&lt;/FONT&gt;,all('Product Category'[Category]))&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; var pct_ratio = DIVIDE(&lt;FONT color="#0000FF"&gt;current_sales&lt;/FONT&gt;,all_sales,0)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; return pct_ratio&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Sales PCT_2 =&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; var &lt;FONT color="#0000FF"&gt;current_sales&lt;/FONT&gt; = sumx(sales, Sales[Quantity]*Sales[Net Price])&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; var all_sales = calculate(&lt;FONT color="#0000FF"&gt;sumx(sales, Sales[Quantity]*Sales[Net Price])&lt;/FONT&gt;,all('Product Category'[Category]))&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; var pct_ratio = DIVIDE(&lt;FONT color="#0000FF"&gt;current_sales&lt;/FONT&gt;,all_sales,0)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp; &amp;nbsp; return pct_ratio&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;(the first one provides all results 100% and ingnores all filters even while the later one provides better results when I categorise the result)&lt;/P&gt;&lt;P&gt;I would be gratefull if someone help me how using the statement or the variable have made the changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2022 08:19:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculate-Function/m-p/2857311#M91887</guid>
      <dc:creator>abbytank</dc:creator>
      <dc:date>2022-10-23T08:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Calculate Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculate-Function/m-p/2857313#M91888</link>
      <description>&lt;P&gt;Variables are not variable, they are constant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You cannot alter the value of a variable once it has been assigned. Therefore this line of code does not change the value of the variable&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var all_sales = calculate(&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;current_sales&lt;/FONT&gt;&lt;SPAN&gt;,all('Product Category'[Category]))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2022 08:30:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Calculate-Function/m-p/2857313#M91888</guid>
      <dc:creator>MattAllington</dc:creator>
      <dc:date>2022-10-23T08:30:31Z</dc:date>
    </item>
  </channel>
</rss>

