<?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 HELP - How to implement dynamic totals when conditionally aggregating in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HELP-How-to-implement-dynamic-totals-when-conditionally/m-p/1491656#M28680</link>
    <description>&lt;P&gt;I assume A and B in your expression are actual Table[Column] names.&amp;nbsp; Also, the way you are using the variable will not be calculated dynamically for each row of the virtual table (Values and Summarize).&amp;nbsp; You need to put your [_UsageLastXDays] there instead.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2020 03:12:47 GMT</pubDate>
    <dc:creator>mahoneypat</dc:creator>
    <dc:date>2020-11-13T03:12:47Z</dc:date>
    <item>
      <title>DAX HELP - How to implement dynamic totals when conditionally aggregating</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HELP-How-to-implement-dynamic-totals-when-conditionally/m-p/1487997#M28527</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;Was wondering if someone could help..&lt;BR /&gt;&lt;BR /&gt;I have the following DAX Expression:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_UsageLastXDays = 
VAR MinUsageDate =
    CALCULATE ( MIN ( Dates[DateISO] ), GameUsage )
RETURN
    IF (
        MinUsageDate
            &amp;gt; TODAY () - NewUsageRange[NewUsageRange Value],
        [UsedGamesForBilling]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which is looking for the minium date in the context of the "games usage" total and then returning the measure "UsedGamesForBilling" only when the minimum value returned is greater than today - a parameter value. For this exmaple it's set to 10 days.&lt;BR /&gt;&lt;BR /&gt;The result then produces this at customer level (column A). It's evaluating correctly for each row. however as you can see the total is blank, which is expected because it has no context of the row it's evaluating. It's only when I wrap the function above in SUMX (AltUsage column) using the context in the first column that I can produce a total. This is fine at this level.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;However...&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;if I expand the context out to two columns, the total will still give me the same result as above. This is also expected because I hard coded the dax to column A only.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What I'd like to know is how I reconfigure the DAX (as outlined above) so that I can make it work, given whatever row context enters my table. the total will sum the visibile rows? e.g. JUST column A = 4. Column A + B VISIBLE = 38&lt;BR /&gt;&lt;BR /&gt;Is this possible somehow dynammically?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Help will be appriciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 17:49:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HELP-How-to-implement-dynamic-totals-when-conditionally/m-p/1487997#M28527</guid>
      <dc:creator>Sla5ha</dc:creator>
      <dc:date>2020-11-11T17:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: DAX HELP - How to implement dynamic totals when conditionally aggregating</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HELP-How-to-implement-dynamic-totals-when-conditionally/m-p/1488576#M28553</link>
      <description>&lt;P&gt;If it is just those two scenarios (A or A+B) then you can use ISINSCOPE on the B column to determine which expression to return.&amp;nbsp; Use your one above for the A only scenario, and the SUMMARIZE equivalent with A and B for that scenario.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 02:19:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HELP-How-to-implement-dynamic-totals-when-conditionally/m-p/1488576#M28553</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-11-12T02:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: DAX HELP - How to implement dynamic totals when conditionally aggregating</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HELP-How-to-implement-dynamic-totals-when-conditionally/m-p/1490623#M28643</link>
      <description>&lt;P&gt;Thanks Pat,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Much appreciated for your swift response.&lt;BR /&gt;&lt;BR /&gt;I implimented this and it is still not producing totals. What am I doing wrong?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_AltUsageLastXDays2 = 
    VAR Usage = [_UsageLastXDays]
    RETURN
            IF(ISINSCOPE(B),   
    
    sumx(values(A),usage),

    sumx(SUMMARIZE(GameUsage,A,B),
    Usage)

    )&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What happens if I want to expand to more than A + B with C being an unknown? Is this possible?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 15:24:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HELP-How-to-implement-dynamic-totals-when-conditionally/m-p/1490623#M28643</guid>
      <dc:creator>Sla5ha</dc:creator>
      <dc:date>2020-11-12T15:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: DAX HELP - How to implement dynamic totals when conditionally aggregating</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HELP-How-to-implement-dynamic-totals-when-conditionally/m-p/1491656#M28680</link>
      <description>&lt;P&gt;I assume A and B in your expression are actual Table[Column] names.&amp;nbsp; Also, the way you are using the variable will not be calculated dynamically for each row of the virtual table (Values and Summarize).&amp;nbsp; You need to put your [_UsageLastXDays] there instead.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 03:12:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-HELP-How-to-implement-dynamic-totals-when-conditionally/m-p/1491656#M28680</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-11-13T03:12:47Z</dc:date>
    </item>
  </channel>
</rss>

