<?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 Separate and sum in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Separate-and-sum/m-p/1937881#M30338</link>
    <description>&lt;P&gt;I have table with values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sas_kod | deb | cred&lt;/P&gt;&lt;P&gt;1209 |&amp;nbsp; 12400 | 0&lt;/P&gt;&lt;P&gt;1209 |&amp;nbsp; 1400 | 900&lt;/P&gt;&lt;P&gt;1209 |&amp;nbsp; 0 | 400&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need create measure wich give me&amp;nbsp; visual&lt;/P&gt;&lt;P&gt;(it give me wong result )&lt;/P&gt;&lt;P&gt;Cred or Deb | Sas_kod | Sum&lt;/P&gt;&lt;P&gt;Cred | 1209 | 1300&lt;/P&gt;&lt;P&gt;Deb | 1209 | -12400&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I trying to write custom column in table with formula&lt;BR /&gt;Cred or Deb = IF ( Left([sas_kod],1) in {"0","1"} &amp;amp;&amp;amp; [cred] &amp;lt;&amp;gt;0 ,&amp;nbsp; "Cred", "Deb")&lt;/P&gt;&lt;P&gt;And use Measure for sum&lt;/P&gt;&lt;P&gt;Sum = SUMX(Table, [cred]-[deb])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it took only first value in second row where are deb and cred, so cant separate this row into two rows. And i loose 1400 deb value as it goes wront to cred but should be separate&lt;/P&gt;&lt;P&gt;So i need sum only cred if sas_kod start with 0 or 1, and sum deb with minus sign&amp;nbsp;if sas_kod start with 0 or 1, but if&amp;nbsp;sas_kod start NOT with 0 or 1 (everithing else) sum should be cred-deb (this should be valid for measure and for formula which separate Cred or deb column)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected visual result&lt;/P&gt;&lt;P&gt;Cred or Deb | Sas_kod | Sum&lt;/P&gt;&lt;P&gt;Cred | 1209 | 1300&lt;/P&gt;&lt;P&gt;Deb | 1209 | -13800&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jul 2021 10:51:13 GMT</pubDate>
    <dc:creator>Analitika</dc:creator>
    <dc:date>2021-07-05T10:51:13Z</dc:date>
    <item>
      <title>Separate and sum</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Separate-and-sum/m-p/1937881#M30338</link>
      <description>&lt;P&gt;I have table with values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sas_kod | deb | cred&lt;/P&gt;&lt;P&gt;1209 |&amp;nbsp; 12400 | 0&lt;/P&gt;&lt;P&gt;1209 |&amp;nbsp; 1400 | 900&lt;/P&gt;&lt;P&gt;1209 |&amp;nbsp; 0 | 400&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need create measure wich give me&amp;nbsp; visual&lt;/P&gt;&lt;P&gt;(it give me wong result )&lt;/P&gt;&lt;P&gt;Cred or Deb | Sas_kod | Sum&lt;/P&gt;&lt;P&gt;Cred | 1209 | 1300&lt;/P&gt;&lt;P&gt;Deb | 1209 | -12400&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I trying to write custom column in table with formula&lt;BR /&gt;Cred or Deb = IF ( Left([sas_kod],1) in {"0","1"} &amp;amp;&amp;amp; [cred] &amp;lt;&amp;gt;0 ,&amp;nbsp; "Cred", "Deb")&lt;/P&gt;&lt;P&gt;And use Measure for sum&lt;/P&gt;&lt;P&gt;Sum = SUMX(Table, [cred]-[deb])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it took only first value in second row where are deb and cred, so cant separate this row into two rows. And i loose 1400 deb value as it goes wront to cred but should be separate&lt;/P&gt;&lt;P&gt;So i need sum only cred if sas_kod start with 0 or 1, and sum deb with minus sign&amp;nbsp;if sas_kod start with 0 or 1, but if&amp;nbsp;sas_kod start NOT with 0 or 1 (everithing else) sum should be cred-deb (this should be valid for measure and for formula which separate Cred or deb column)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected visual result&lt;/P&gt;&lt;P&gt;Cred or Deb | Sas_kod | Sum&lt;/P&gt;&lt;P&gt;Cred | 1209 | 1300&lt;/P&gt;&lt;P&gt;Deb | 1209 | -13800&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 10:51:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Separate-and-sum/m-p/1937881#M30338</guid>
      <dc:creator>Analitika</dc:creator>
      <dc:date>2021-07-05T10:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Separate and sum</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Separate-and-sum/m-p/1941877#M30374</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/229137"&gt;@Analitika&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer to this measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var 
c_o_d_ = SELECTEDVALUE('Table'[Cred or Deb])
var
sas_ = LEFT(MAX('Table'[Sas_kod]),1)
return SWITCH(TRUE(),
            c_o_d_="Deb"&amp;amp;&amp;amp;sas_ in {"0","1"},CALCULATE(SUM('Table'[deb]),ALLEXCEPT('Table','Table'[Sas_kod])),
            c_o_d_="Cred"&amp;amp;&amp;amp;sas_ in {"0","1"},CALCULATE(SUM('Table'[cred]),ALLEXCEPT('Table','Table'[Sas_kod])),
            SUM('Table'[cred])-SUM('Table'[deb]))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vlianlmsft_0-1625638533899.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/547834i24A39A4DE8728845/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vlianlmsft_0-1625638533899.png" alt="Vlianlmsft_0-1625638533899.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;BR /&gt;Liang&lt;BR /&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;</description>
      <pubDate>Wed, 07 Jul 2021 06:15:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Separate-and-sum/m-p/1941877#M30374</guid>
      <dc:creator>V-lianl-msft</dc:creator>
      <dc:date>2021-07-07T06:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Separate and sum</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Separate-and-sum/m-p/1942266#M30378</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/182446"&gt;@V-lianl-msft&lt;/a&gt;&amp;nbsp; &amp;nbsp;ty for reply&lt;/P&gt;&lt;P&gt;on big data it work wrong&lt;/P&gt;&lt;P&gt;as&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;c_o_d_="Deb"&amp;amp;&amp;amp;sas_ in {"0","1"},CALCULATE(SUM('Table'[deb]),ALLEXCEPT('Table','Table'[Sas_kod]))&lt;/PRE&gt;&lt;P&gt;never been hapen as formula Cred or Deb always choose cred value&lt;/P&gt;&lt;P&gt;also this should be done only in measure as many other measures is linked to period and it cant be dublicate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it should be like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cred or Deb =&lt;BR /&gt;IF (&lt;BR /&gt;Left([sas_kod],1) in {"0","1"} &amp;amp;&amp;amp; [cred] &amp;lt;&amp;gt;0 &amp;amp;&amp;amp; [deb] &amp;lt;&amp;gt;0,&amp;nbsp; "Cred and Deb",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IF ( Left([sas_kod],1) in {"0","1"} &amp;amp;&amp;amp; [cred] &amp;lt;&amp;gt;0, "Cred", "Deb")&lt;BR /&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and measure&lt;BR /&gt;if "cred and deb" then credsum = [cred]-0 and debsum =0 - [deb]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Analitika_0-1625644921997.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/547950i57E8BC27BD00E2AC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Analitika_0-1625644921997.png" alt="Analitika_0-1625644921997.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;i didnt see deb at all, and all Sum values is same&lt;/P&gt;&lt;P&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://easyupload.io/etibt5" target="_blank" rel="noopener"&gt;https://easyupload.io/etibt5&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 08:50:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Separate-and-sum/m-p/1942266#M30378</guid>
      <dc:creator>Analitika</dc:creator>
      <dc:date>2021-07-07T08:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Separate and sum</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Separate-and-sum/m-p/1947636#M30422</link>
      <description>&lt;P&gt;See if this meets your needs.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vlianlmsft_0-1625817156909.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/549816i4A7057635FC79ACA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vlianlmsft_0-1625817156909.png" alt="Vlianlmsft_0-1625817156909.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 07:52:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Separate-and-sum/m-p/1947636#M30422</guid>
      <dc:creator>V-lianl-msft</dc:creator>
      <dc:date>2021-07-09T07:52:59Z</dc:date>
    </item>
  </channel>
</rss>

