<?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: Totals are not working properly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271221#M121258</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="427514" data-lia-user-login="Sidhu" class="lia-mention lia-mention-user"&gt;Sidhu&lt;/a&gt;&amp;nbsp;Try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Diff V3 = 
    VAR __Table = 
        ADDCOLUMNS(
            ADDCOLUMNS(
                SUMMARIZE( 'Table', [Category A], [Category B], "__Hours", SUM( 'Table'[Hours] ) ),
                "__BestHours", [Best Hours]
            ),
            "__Diff", [__Hours] - [__BestHours]
        )
    VAR __Diff = [Diff V1]
    VAR __Result = 
        IF( 
            ISINSCOPE( 'Table'[Category A] ),
            __Diff,
            SUMX( FILTER( __Table, [__Diff] &amp;gt; 0 ), [__Diff] )
        )
RETURN
    __Result&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 06 Jun 2023 20:01:35 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2023-06-06T20:01:35Z</dc:date>
    <item>
      <title>Totals are not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271102#M121244</link>
      <description>&lt;P&gt;I have the data in the below format, I am trying to get the difference between the best and hours while neglecting the negatives in total. So the diff column in the visual should show 8.64 instead of 6.56. I have tried Inscope and it is not working, am i missing something here?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here is the link for the file.&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!AvujJeYUZlNThPh-ARfb0lZ2df-0SA?e=2Ic9CN" target="_blank"&gt;Best.pbix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 17:39:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271102#M121244</guid>
      <dc:creator>Sidhu</dc:creator>
      <dc:date>2023-06-06T17:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Totals are not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271117#M121247</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="427514" data-lia-user-login="Sidhu" class="lia-mention lia-mention-user"&gt;Sidhu&lt;/a&gt;&amp;nbsp;First, please vote for this idea: &lt;A href="https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e" target="_blank"&gt;https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This looks like a measure totals problem. Very common. See my post about it here: &lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376" target="_blank"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also: &lt;A href="https://youtu.be/uXRriTN0cfY" target="_blank"&gt;https://youtu.be/uXRriTN0cfY&lt;/A&gt;&lt;BR /&gt;And: &lt;A href="https://youtu.be/n4TYhF2ARe8" target="_blank"&gt;https://youtu.be/n4TYhF2ARe8&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 17:52:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271117#M121247</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-06-06T17:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Totals are not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271144#M121250</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for quick response, I have tried the methods which you mentioned. It is not working properly, I tried InScope, HasOneValue &amp;amp; HasOneFilter. I think the way my data is represented might be causing issues. Can you take a look at the file which I added in the earlier post?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 18:26:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271144#M121250</guid>
      <dc:creator>Sidhu</dc:creator>
      <dc:date>2023-06-06T18:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Totals are not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271217#M121257</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="427514" data-lia-user-login="Sidhu" class="lia-mention lia-mention-user"&gt;Sidhu&lt;/a&gt;&amp;nbsp;Sure, I'll give it a once over.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 19:55:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271217#M121257</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-06-06T19:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Totals are not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271221#M121258</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="427514" data-lia-user-login="Sidhu" class="lia-mention lia-mention-user"&gt;Sidhu&lt;/a&gt;&amp;nbsp;Try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Diff V3 = 
    VAR __Table = 
        ADDCOLUMNS(
            ADDCOLUMNS(
                SUMMARIZE( 'Table', [Category A], [Category B], "__Hours", SUM( 'Table'[Hours] ) ),
                "__BestHours", [Best Hours]
            ),
            "__Diff", [__Hours] - [__BestHours]
        )
    VAR __Diff = [Diff V1]
    VAR __Result = 
        IF( 
            ISINSCOPE( 'Table'[Category A] ),
            __Diff,
            SUMX( FILTER( __Table, [__Diff] &amp;gt; 0 ), [__Diff] )
        )
RETURN
    __Result&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 06 Jun 2023 20:01:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271221#M121258</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-06-06T20:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Totals are not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271291#M121262</link>
      <description>&lt;P&gt;Thank you, it is working now.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 20:48:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Totals-are-not-working-properly/m-p/3271291#M121262</guid>
      <dc:creator>Sidhu</dc:creator>
      <dc:date>2023-06-06T20:48:46Z</dc:date>
    </item>
  </channel>
</rss>

