<?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: Table total error in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/352056#M158366</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/52155"&gt;@BLM&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The cause is the "Total" has its own context, which doesn't add up the values of the other rows. You try out this formula. If you want a accurate formula, please share your file or a dummy sample.&lt;/P&gt;&lt;PRE&gt;afabricar =
VAR temp =
    IF (
        SUM ( Productos[smincorregido] ) = 0;
        [sminnew];
        SUM ( Productos[smincorregido] )
    )
        - [stockactual]
        + IF ( [totalconsumos] &amp;lt; [sminnew]; [sminnew]; [totalconsumos] )
        - 'ops+stocks+cargas'[opspdts]
RETURN
    IF (
        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;HASONEVALUE ( 'TableName'[codnombre] );&lt;/STRONG&gt;&lt;/FONT&gt;
        temp;
        SUMX (
            SUMMARIZE (
                'TableName';
                'TableName'[codnombre];
                "temp1"; IF (
                    SUM ( Productos[smincorregido] ) = 0;
                    [sminnew];
                    SUM ( Productos[smincorregido] )
                )
                    - [stockactual]
                    + IF ( [totalconsumos] &amp;lt; [sminnew]; [sminnew]; [totalconsumos] )
                    - 'ops+stocks+cargas'[opspdts]
            );
            [temp1]
        )
    )&lt;/PRE&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2018 01:55:55 GMT</pubDate>
    <dc:creator>v-jiascu-msft</dc:creator>
    <dc:date>2018-02-06T01:55:55Z</dc:date>
    <item>
      <title>Table total error</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/351289#M157964</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've maked a table with several measures. Specifically&amp;nbsp;the measure "afabricar" don't want that show negatives values (if the result it's negative the valued must be zero).&lt;/P&gt;&lt;P&gt;Well, if the measure show negatives values, the "Total" it's Ok, but if I make that the result show zero, the "Total" it's the same, don't changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case A&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="casea.jpg" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/80582i2A6A831F087F3AD0/image-size/large?v=v2&amp;amp;px=999" role="button" title="casea.jpg" alt="casea.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;afabricar =&lt;BR /&gt;IF(SUM(Productos[smincorregido])=0;[sminnew];SUM(Productos[smincorregido]))&lt;BR /&gt;-[stockactual]&lt;BR /&gt;+IF([totalconsumos]&amp;lt;[sminnew];[sminnew];[totalconsumos])&lt;BR /&gt;-'ops+stocks+cargas'[opspdts]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case B:&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="caseb.jpg" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/80583i6E7927FAAFCFDD17/image-size/large?v=v2&amp;amp;px=999" role="button" title="caseb.jpg" alt="caseb.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;afabricar = if(&lt;BR /&gt;(IF(SUM(Productos[smincorregido])=0;[sminnew];SUM(Productos[smincorregido]))&lt;BR /&gt;-[stockactual]&lt;BR /&gt;+IF([totalconsumos]&amp;lt;[sminnew];[sminnew];[totalconsumos])&lt;BR /&gt;-'ops+stocks+cargas'[opspdts])&amp;lt;0;&lt;BR /&gt;0;&lt;/P&gt;&lt;P&gt;IF(SUM(Productos[smincorregido])=0;[sminnew];SUM(Productos[smincorregido]))&lt;BR /&gt;-[stockactual]&lt;BR /&gt;+IF([totalconsumos]&amp;lt;[sminnew];[sminnew];[totalconsumos])&lt;BR /&gt;-'ops+stocks+cargas'[opspdts]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's the problem?????&amp;nbsp; &lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://community.fabric.microsoft.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 19:34:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/351289#M157964</guid>
      <dc:creator>BLM</dc:creator>
      <dc:date>2018-02-04T19:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Table total error</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/352056#M158366</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/52155"&gt;@BLM&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The cause is the "Total" has its own context, which doesn't add up the values of the other rows. You try out this formula. If you want a accurate formula, please share your file or a dummy sample.&lt;/P&gt;&lt;PRE&gt;afabricar =
VAR temp =
    IF (
        SUM ( Productos[smincorregido] ) = 0;
        [sminnew];
        SUM ( Productos[smincorregido] )
    )
        - [stockactual]
        + IF ( [totalconsumos] &amp;lt; [sminnew]; [sminnew]; [totalconsumos] )
        - 'ops+stocks+cargas'[opspdts]
RETURN
    IF (
        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;HASONEVALUE ( 'TableName'[codnombre] );&lt;/STRONG&gt;&lt;/FONT&gt;
        temp;
        SUMX (
            SUMMARIZE (
                'TableName';
                'TableName'[codnombre];
                "temp1"; IF (
                    SUM ( Productos[smincorregido] ) = 0;
                    [sminnew];
                    SUM ( Productos[smincorregido] )
                )
                    - [stockactual]
                    + IF ( [totalconsumos] &amp;lt; [sminnew]; [sminnew]; [totalconsumos] )
                    - 'ops+stocks+cargas'[opspdts]
            );
            [temp1]
        )
    )&lt;/PRE&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 01:55:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/352056#M158366</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2018-02-06T01:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Table total error</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/352447#M158536</link>
      <description>&lt;P&gt;I'm tryed out your formula, and the result it's the same. Show the negatives values and the "Total" it's Ok, but the question is that don't show the negatives values but 0.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="acumulado.jpg" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/80795i664FCA671B6E514A/image-size/large?v=v2&amp;amp;px=999" role="button" title="acumulado.jpg" alt="acumulado.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 10:58:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/352447#M158536</guid>
      <dc:creator>BLM</dc:creator>
      <dc:date>2018-02-06T10:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Table total error</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/352503#M158563</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/52155"&gt;@BLM&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this formula,&amp;nbsp;please. If it still doesn't work, please share your file or a dummy sample.&lt;/P&gt;&lt;PRE&gt;afabricar =
VAR temp =
    IF (
        SUM ( Productos[smincorregido] ) = 0;
        [sminnew];
        SUM ( Productos[smincorregido] )
    )
        - [stockactual]
        + IF ( [totalconsumos] &amp;lt; [sminnew]; [sminnew]; [totalconsumos] )
        - 'ops+stocks+cargas'[opspdts]
RETURN
    IF (
        HASONEVALUE ( 'TableName'[codnombre] );
        &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;IF ( temp &amp;lt; 0; 0; temp );&lt;/FONT&gt;&lt;/STRONG&gt;
        SUMX (
            SUMMARIZE (
                'TableName';
                'TableName'[codnombre];
                "temp1"; IF (
                    SUM ( Productos[smincorregido] ) = 0;
                    [sminnew];
                    SUM ( Productos[smincorregido] )
                )
                    - [stockactual]
                    + IF ( [totalconsumos] &amp;lt; [sminnew]; [sminnew]; [totalconsumos] )
                    - 'ops+stocks+cargas'[opspdts]
            );
            [temp1]
        )
    )&lt;/PRE&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 12:12:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/352503#M158563</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2018-02-06T12:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Table total error</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/352568#M158592</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/52155"&gt;@BLM&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand your measure [afabricar] returns negative values as '0', and positive values stay the same, right?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Correct totals for afabricar = SUMX(SUMMARIZE('tableforcodnombre', 'tableforcodnombre'[codnombre]), [afabricar])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(where 'tableforcodnombre' is obviously the lookup table where your 'codnombre' column is; if you don't have a lookup table for codnombre, you'll have to wrap it in VALUES)&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 14:04:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/352568#M158592</guid>
      <dc:creator>PaulDBrown</dc:creator>
      <dc:date>2018-02-06T14:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Table total error</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/363083#M164048</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/52155"&gt;@BLM&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please mark the proper answer as solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards!&lt;BR /&gt;Dale&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 09:37:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/363083#M164048</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2018-02-22T09:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Table total error</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/363476#M164247</link>
      <description>Thank u so much. It’s the Best forum</description>
      <pubDate>Thu, 22 Feb 2018 17:26:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Table-total-error/m-p/363476#M164247</guid>
      <dc:creator>BLM</dc:creator>
      <dc:date>2018-02-22T17:26:51Z</dc:date>
    </item>
  </channel>
</rss>

