<?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 Summing values in a column based on two conditions in other columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1200711#M19177</link>
    <description>&lt;P&gt;I have a huge table, and example of four columns from the table is as follows:&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;&lt;P&gt;In this table i have c_id (clients), p_id (periods) and val=values. I want to be able to calculate tot_val. The way I want tot_val to be calculated is, for example, for c_id=1 and p_id=19931201, we have that val = (10,15,30), so tot_val should return 55 on all three rows with c_id=1 and p_id=19931201. I tried many options but did not get the correct results. Please let me know if you have any suggestions on how to do this.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jul 2020 15:46:59 GMT</pubDate>
    <dc:creator>bamba98</dc:creator>
    <dc:date>2020-07-03T15:46:59Z</dc:date>
    <item>
      <title>Summing values in a column based on two conditions in other columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1200711#M19177</link>
      <description>&lt;P&gt;I have a huge table, and example of four columns from the table is as follows:&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;&lt;P&gt;In this table i have c_id (clients), p_id (periods) and val=values. I want to be able to calculate tot_val. The way I want tot_val to be calculated is, for example, for c_id=1 and p_id=19931201, we have that val = (10,15,30), so tot_val should return 55 on all three rows with c_id=1 and p_id=19931201. I tried many options but did not get the correct results. Please let me know if you have any suggestions on how to do this.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 15:46:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1200711#M19177</guid>
      <dc:creator>bamba98</dc:creator>
      <dc:date>2020-07-03T15:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column based on two conditions in other columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1200740#M19181</link>
      <description>&lt;P&gt;You can do this in many ways, with SUMX, ALLEXCEPT etc.&amp;nbsp; Here's a pedestrian method:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;tot_val = 
var c= selectedvalue(Table[c_id])
var p= selectedvalue(Table[p_id])
return calculate(sum(Table[val]),allselected(Table),Table[c_id]=c,Table[p_id]=p)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 16:09:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1200740#M19181</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-03T16:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column based on two conditions in other columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1200865#M19186</link>
      <description>&lt;P&gt;Calculate (sum(Val), allexcept(Cid,oid))&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 17:49:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1200865#M19186</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-07-03T17:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column based on two conditions in other columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1201867#M19233</link>
      <description>&lt;P&gt;Thank you very much &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="4037" data-lia-user-login="stevedep" class="lia-mention lia-mention-user"&gt;stevedep&lt;/a&gt;&amp;nbsp;, that works fine!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I noticed that there is another column "Outstanding" in my table that contains values which are zero. How can I exclude these rows in my calculation?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2020 11:54:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1201867#M19233</guid>
      <dc:creator>bamba98</dc:creator>
      <dc:date>2020-07-05T11:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column based on two conditions in other columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1201907#M19238</link>
      <description>Just include that column as well in the ALLEXCEPT ( Table, Column1, Column2 )</description>
      <pubDate>Sun, 05 Jul 2020 13:51:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1201907#M19238</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-05T13:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column based on two conditions in other columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1201926#M19244</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;This return the values of val in tot_val. Allow me to explain it better:&lt;/P&gt;&lt;P&gt;Let zoom in to &lt;STRONG&gt;c_id=1&lt;/STRONG&gt; and &lt;STRONG&gt;p_id=19931201&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;What I want is for the expression to return the sum of &lt;STRONG&gt;val&lt;/STRONG&gt; where&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;outstanding&amp;nbsp;&lt;/STRONG&gt;is greater than 0. With the solution of&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="4037" data-lia-user-login="stevedep" class="lia-mention lia-mention-user"&gt;stevedep&lt;/a&gt;&amp;nbsp;, I get&amp;nbsp;&lt;STRONG&gt;tot_val = 110,&amp;nbsp;&lt;/STRONG&gt;but I want it to return 55 as it should ignore the rows where&amp;nbsp;&lt;STRONG&gt;outstanding =0.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2020 14:31:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1201926#M19244</guid>
      <dc:creator>bamba98</dc:creator>
      <dc:date>2020-07-05T14:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column based on two conditions in other columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1201937#M19248</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;TotalValue =
VAR Client = Bamba[C_ID]
VAR Periods = Bamba[P_ID]
VAR Outstanding = Bamba[Outstanding]
VAR SameRows =
    FILTER (
        Bamba,
        Bamba[C_ID] = Client
            &amp;amp;&amp;amp; Bamba[P_ID] = Periods
            &amp;amp;&amp;amp; Bamba[Outstanding] &amp;lt;&amp;gt; 0
    )
VAR Result =
    CALCULATE ( SUM ( Bamba[Val] ), SameRows )
RETURN
    IF ( Outstanding = 0, 0, Result )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2020 14:53:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1201937#M19248</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-05T14:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column based on two conditions in other columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1201978#M19253</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="243511" data-lia-user-login="bamba98" class="lia-mention lia-mention-user"&gt;bamba98&lt;/a&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;Create a measure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Value =
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[C_Id]
            = MAX ( 'Table'[C_Id] )
            &amp;amp;&amp;amp; 'Table'[P_Id]
                = MAX ( 'Table'[P_Id] )
            &amp;amp;&amp;amp; 'Table'[Outstanding] &amp;gt; 0
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do a Visual Filter for Outstanding.&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;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jul 2020 16:08:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summing-values-in-a-column-based-on-two-conditions-in-other/m-p/1201978#M19253</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-05T16:08:04Z</dc:date>
    </item>
  </channel>
</rss>

