<?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 Sum if with two different columns in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Sum-if-with-two-different-columns/m-p/3486060#M45006</link>
    <description>&lt;P&gt;I know how I would do this in excel with just a couple of sumif statements but I can't get that same result in BI with filters. I have two columns representing Mechanic 2 and Mechanic 3. A mechanic can be listed as either M2 or M3 on any line item so I'm trying to total the labor column for a specific mechanic based off both columns. I don't want to use a measure because it needs to be dynamic with the date changes and the selected mechanic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;this is the structure of the table. So if trans.mech2 = 41 or trans.mech3 = 41 sum tech labor $ is what i'm needing.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2023 16:56:40 GMT</pubDate>
    <dc:creator>TiresAndMore</dc:creator>
    <dc:date>2023-10-19T16:56:40Z</dc:date>
    <item>
      <title>Sum if with two different columns</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Sum-if-with-two-different-columns/m-p/3486060#M45006</link>
      <description>&lt;P&gt;I know how I would do this in excel with just a couple of sumif statements but I can't get that same result in BI with filters. I have two columns representing Mechanic 2 and Mechanic 3. A mechanic can be listed as either M2 or M3 on any line item so I'm trying to total the labor column for a specific mechanic based off both columns. I don't want to use a measure because it needs to be dynamic with the date changes and the selected mechanic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;this is the structure of the table. So if trans.mech2 = 41 or trans.mech3 = 41 sum tech labor $ is what i'm needing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 16:56:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Sum-if-with-two-different-columns/m-p/3486060#M45006</guid>
      <dc:creator>TiresAndMore</dc:creator>
      <dc:date>2023-10-19T16:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if with two different columns</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Sum-if-with-two-different-columns/m-p/3489410#M45027</link>
      <description>&lt;P&gt;Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue. &lt;BR /&gt;If you are unsure how to do that please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;If you want to get answers faster please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2023 23:34:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Sum-if-with-two-different-columns/m-p/3489410#M45027</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-10-21T23:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if with two different columns</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Sum-if-with-two-different-columns/m-p/3493263#M45070</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="633565" data-lia-user-login="TiresAndMore" class="lia-mention lia-mention-user"&gt;TiresAndMore&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to create a measure as below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum if =
CALCULATE (
    SUM ( 'TableName'[Tech Labor $] ),
    FILTER (
        'TableName',
        OR ( 'TableName'[TRANS.MECH2] = 41, 'TableName'[TRANS.MECH3] = 41 )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;My Sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 08:08:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Sum-if-with-two-different-columns/m-p/3493263#M45070</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-24T08:08:47Z</dc:date>
    </item>
  </channel>
</rss>

