<?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: SUM Column in Value Exists in Another Table in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3028236#M1031237</link>
    <description>&lt;P&gt;Thanks for your response. I am abit confused on how to achieve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;creating a visual that sums hours in dataset 1&lt;/LI&gt;&lt;LI&gt;Creating a relationship between ID in both datasets&lt;/LI&gt;&lt;LI&gt;Filtering out the visual if 'Estimate Erect Hours' or 'Estimate Dismantle Hours' are greater than 0&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is not working as it doesnt look to see if the 'ID' in dataset 1 relates to a 'Job Type' erect or dismantle.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2023 09:45:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-01-18T09:45:43Z</dc:date>
    <item>
      <title>SUM Column in Value Exists in Another Table</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3028136#M1031212</link>
      <description>&lt;P&gt;I have two datasets&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset 1&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Hours&lt;/TD&gt;&lt;TD&gt;Job Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;Erect&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;Dismantle&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset 2&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Estimate &lt;STRONG&gt;Erect&lt;/STRONG&gt; Hours&lt;/TD&gt;&lt;TD&gt;Estimate &lt;STRONG&gt;Dismantle&lt;/STRONG&gt; Hours&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a measure that can do the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUM column 'Hours' in dataset 1. But only if the hours relating to that ID and 'Job Type' are greater than 0 in dataset 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, dataset 1 shows 'ID' 1 has 10 'Hours' for a 'Job Type' &lt;STRONG&gt;Erect&lt;/STRONG&gt;. Dataset 2 has 15 'Estimate &lt;STRONG&gt;Erect&lt;/STRONG&gt; Hours' which is matching to the existing 'Job Type' shown in dataset 1 and is greater than 0 therefore 'Hours' in dataset 1 will be summed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 09:05:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3028136#M1031212</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-18T09:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: SUM Column in Value Exists in Another Table</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3028169#M1031221</link>
      <description>&lt;P&gt;Hi, You can easly make it by creation of properly bounding beetwen database 1 and database2 and in graph set a sum and graph filter making assumption based on database2&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 09:20:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3028169#M1031221</guid>
      <dc:creator>Jacekk111</dc:creator>
      <dc:date>2023-01-18T09:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: SUM Column in Value Exists in Another Table</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3028236#M1031237</link>
      <description>&lt;P&gt;Thanks for your response. I am abit confused on how to achieve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;creating a visual that sums hours in dataset 1&lt;/LI&gt;&lt;LI&gt;Creating a relationship between ID in both datasets&lt;/LI&gt;&lt;LI&gt;Filtering out the visual if 'Estimate Erect Hours' or 'Estimate Dismantle Hours' are greater than 0&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is not working as it doesnt look to see if the 'ID' in dataset 1 relates to a 'Job Type' erect or dismantle.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 09:45:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3028236#M1031237</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-18T09:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: SUM Column in Value Exists in Another Table</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3030236#M1031732</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, you want to get the sum of [Hours] according to the another table the job type hour &amp;gt; 0.&lt;/P&gt;
&lt;P&gt;Here are the steps you can refer to :&lt;BR /&gt;(1)My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2)We can create a measure like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = var _t =ADDCOLUMNS( ALLSELECTED('Table 1') , "flag" ,
var _id = [ID] var _job=[Job Type] var _t = FILTER('Table 2' ,'Table 2'[ID] = _id)   return
IF(  OR( _job = "Erect" &amp;amp;&amp;amp; MAXX(_t, [Estimate Erect Hours])&amp;gt;0 ,_job = "Dismantle" &amp;amp;&amp;amp; MAXX(_t, [Estimate Dismantle Hours])&amp;gt;0 )  , 1, 0))
 return
 SUMX(_t ,IF([flag]=1,[Hours],0))&lt;/LI-CODE&gt;
&lt;P&gt;(3)Then we can get the total:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 03:43:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3030236#M1031732</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2023-01-19T03:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: SUM Column in Value Exists in Another Table</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3030616#M1031819</link>
      <description>&lt;P&gt;Thank you very much for taking the time to solve the problem!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are a life saver &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 08:12:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/SUM-Column-in-Value-Exists-in-Another-Table/m-p/3030616#M1031819</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-19T08:12:25Z</dc:date>
    </item>
  </channel>
</rss>

