<?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 and Difference based on column field in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Sum-and-Difference-based-on-column-field/m-p/4274739#M58201</link>
    <description>&lt;P&gt;I'm not sure how complex your actual scenario is but have a look at the attached and see if it helps at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Nov 2024 00:53:30 GMT</pubDate>
    <dc:creator>KNP</dc:creator>
    <dc:date>2024-11-08T00:53:30Z</dc:date>
    <item>
      <title>Sum and Difference based on column field</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Sum-and-Difference-based-on-column-field/m-p/4273994#M58192</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have table Similar to the Input image shown , how do I obtain the output similar to the image shown,&lt;/P&gt;&lt;P&gt;INPUT:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jenani_user_0-1730980520024.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1195774i71C165B1BDB8FA1A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jenani_user_0-1730980520024.png" alt="jenani_user_0-1730980520024.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;OUTPUT:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jenani_user_1-1730980608821.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1195778iB473229C9B88C65D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jenani_user_1-1730980608821.png" alt="jenani_user_1-1730980608821.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly suggest any idea as there are around 10 columns similar to values(in B column of input)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 11:58:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Sum-and-Difference-based-on-column-field/m-p/4273994#M58192</guid>
      <dc:creator>jenani_user</dc:creator>
      <dc:date>2024-11-07T11:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sum and Difference based on column field</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Sum-and-Difference-based-on-column-field/m-p/4274739#M58201</link>
      <description>&lt;P&gt;I'm not sure how complex your actual scenario is but have a look at the attached and see if it helps at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 00:53:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Sum-and-Difference-based-on-column-field/m-p/4274739#M58201</guid>
      <dc:creator>KNP</dc:creator>
      <dc:date>2024-11-08T00:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sum and Difference based on column field</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Sum-and-Difference-based-on-column-field/m-p/4275091#M58203</link>
      <description>&lt;P&gt;Thanks for the reply from KNP&amp;nbsp;, please allow me to provide another insight:&amp;nbsp; &lt;BR /&gt;Hi&amp;nbsp; &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/401438"&gt;@jenani_user&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table =
var _table1=
SUMMARIZE(
    'Input',
    [A],
    "C","B+C",
    "B",
    SUMX(FILTER('Input',[A]=EARLIER([A])&amp;amp;&amp;amp;[C]="B"),[B])+
    SUMX(FILTER('Input',[A]=EARLIER([A])&amp;amp;&amp;amp;[C]="C"),[B]))
var _table2=
SUMMARIZE(
    _table1,
    [A],
    "C","A-(B+C)",
    "B",
    SUMX(FILTER('Input',[A]=EARLIER([A])&amp;amp;&amp;amp;[C]="A"),[B])-
    SUMX(FILTER(_table1,[A]=EARLIER([A])&amp;amp;&amp;amp;[C]="B+C"),[B]))
var _table=
SUMMARIZE(
    'Input',[A],[C],[B])
return
UNION(
    _table,_table1,_table2)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vyangliumsft_0-1731047134969.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1196244i51826F994B807853/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vyangliumsft_0-1731047134969.png" alt="vyangliumsft_0-1731047134969.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vyangliumsft_1-1731047134970.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1196245iCEE68C752EEA97EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vyangliumsft_1-1731047134970.png" alt="vyangliumsft_1-1731047134970.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 06:26:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Sum-and-Difference-based-on-column-field/m-p/4275091#M58203</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-08T06:26:33Z</dc:date>
    </item>
  </channel>
</rss>

