<?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 DAX : in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1192945#M18924</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with 3 columns :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;COUNTRY (string)&lt;/LI&gt;&lt;LI&gt;LEVEL (integer)&lt;/LI&gt;&lt;LI&gt;Quantity (integer)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I want to set up a Pivot Table with :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Line : COUNTRY&lt;/LI&gt;&lt;LI&gt;Column : LEVEL&lt;/LI&gt;&lt;LI&gt;Values : 3 measures :&lt;UL&gt;&lt;LI&gt;Measure1 = Sum(Qty) for selected COUNTRY and LEVEL&lt;/LI&gt;&lt;LI&gt;Measure2 = Sum(Qty) for selected COUNTRY and next LEVEL (i.e. &lt;STRONG&gt;&lt;U&gt;LEVEL + 1&lt;/U&gt;&lt;/STRONG&gt;)&lt;/LI&gt;&lt;LI&gt;Measure3 = Measure1 / Measure2&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the DAX formula for Measure2 ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jun 2020 16:24:45 GMT</pubDate>
    <dc:creator>jct999</dc:creator>
    <dc:date>2020-06-30T16:24:45Z</dc:date>
    <item>
      <title>DAX :</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1192945#M18924</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with 3 columns :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;COUNTRY (string)&lt;/LI&gt;&lt;LI&gt;LEVEL (integer)&lt;/LI&gt;&lt;LI&gt;Quantity (integer)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I want to set up a Pivot Table with :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Line : COUNTRY&lt;/LI&gt;&lt;LI&gt;Column : LEVEL&lt;/LI&gt;&lt;LI&gt;Values : 3 measures :&lt;UL&gt;&lt;LI&gt;Measure1 = Sum(Qty) for selected COUNTRY and LEVEL&lt;/LI&gt;&lt;LI&gt;Measure2 = Sum(Qty) for selected COUNTRY and next LEVEL (i.e. &lt;STRONG&gt;&lt;U&gt;LEVEL + 1&lt;/U&gt;&lt;/STRONG&gt;)&lt;/LI&gt;&lt;LI&gt;Measure3 = Measure1 / Measure2&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the DAX formula for Measure2 ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 16:24:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1192945#M18924</guid>
      <dc:creator>jct999</dc:creator>
      <dc:date>2020-06-30T16:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAX :</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1193503#M18953</link>
      <description>&lt;P&gt;Measure 2 =&amp;nbsp;&lt;/P&gt;&lt;P&gt;var L=selectedvalue(table[Level])&lt;/P&gt;&lt;P&gt;return calculate(sum(Table[quantity]),table[Level]=L+1)&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 22:37:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1193503#M18953</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-30T22:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: DAX :</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1194193#M18960</link>
      <description>&lt;P&gt;It works fine ! Thanks&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Before asking on the forum, I tried SELECTEDVALUE but I put it in the CALCULATE expression, and it did not work.&lt;/P&gt;&lt;P&gt;So, The solution seems to use SELECTEDVALUE in a VAR expression...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 07:24:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1194193#M18960</guid>
      <dc:creator>jct999</dc:creator>
      <dc:date>2020-07-01T07:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: DAX :</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1194286#M18961</link>
      <description>&lt;P&gt;If you want to attain the same behaviour without variables then you will have to use explicit FILTER, for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure =
CALCULATE (
    [Total Sales],
    FILTER (
        ALL ( Product[Brand] ),
        Product[Brand] = SELECTEDVALUE ( Product[Brand] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because writing aggregation functions like SUM, AVERAGE, MAX are not allowed while doing boolean filter operations, and same is for SELECTEDVALUE, hence the following won't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure =
CALCULATE (
    [Total Sales],
    'Product'[Brand] = SELECTEDVALUE ( 'Product'[Brand] )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 07:58:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1194286#M18961</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-01T07:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: DAX :</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1194960#M18980</link>
      <description>&lt;P&gt;There's also the added complexity with FILTER (ALL()) - that may produce more results than intended in the visual context.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 12:13:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1194960#M18980</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-01T12:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: DAX :</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1195022#M18981</link>
      <description>&lt;P&gt;Correct, in that case he can either wrap CALCULATE's filter arguments with KEEPFILTERS or use VALUES as per the requirements.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 12:37:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX/m-p/1195022#M18981</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-01T12:37:14Z</dc:date>
    </item>
  </channel>
</rss>

