<?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 Incorrect Total - Need help with HASONEFILTER in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499938#M134188</link>
    <description>&lt;P&gt;Hi Greg - thanks for the feedback - that got me close, but there was nothing on the Total line...&amp;nbsp; I did look at your reference articles earlier and revisited them and did get it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My solution was this:&lt;/P&gt;&lt;P&gt;The measure I was struggling with I kept simple:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;Realized New Business =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;var _CP = [Realized New Business CP]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;var _PP = [Realized New Business PP]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;var _rnb = _CP-_PP&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;RETURN IF(_rnb &amp;lt; 0, 0, _rnb)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, I added a new measure:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;Total RNB =&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;IF(HASONEFILTER('tablename'[ID]), [Realized New Business], SUMX(VALUES('tablename'[ID]),[Realized New Business])&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I thought I could do it without adding another measure, but at least this did the trick - based on the articles you provided.&amp;nbsp; Thank you!!&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 21:09:24 GMT</pubDate>
    <dc:creator>LuukP</dc:creator>
    <dc:date>2023-10-26T21:09:24Z</dc:date>
    <item>
      <title>Table Incorrect Total - Need help with HASONEFILTER</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499778#M134181</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for yet another 'Incorrect Total' message, but I haven't been able to figure this one out...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my table visual with the incorrect total in the "Realized New Business" column:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The Realized New Business CP column sums dollar amounts in a measure for the Current Period.&lt;/P&gt;&lt;P&gt;The Realized New Business PP column sums dollar amounts in a measure for the Previous Period.&lt;/P&gt;&lt;P&gt;The logic for the Realized New Business column is 'if CP - PP &amp;lt; 0 then 0 otherwise CP - PP'.&amp;nbsp; Here is the actual formula:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;Realized New Business =&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_CP&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;[Realized New Business CP]&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_PP&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;[Realized New Business PP]&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;HASONEFILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'SLX ACCOUNT'&lt;/SPAN&gt;&lt;SPAN&gt;[ACCOUNT]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_CP&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;_PP&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;_CP&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;_PP&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;// THIS IS WHERE I NEED HELP&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Can anyone help with the part of the formula that I've bolded?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Luuk&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 26 Oct 2023 18:44:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499778#M134181</guid>
      <dc:creator>LuukP</dc:creator>
      <dc:date>2023-10-26T18:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Table Incorrect Total - Need help with HASONEFILTER</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499848#M134185</link>
      <description>&lt;P&gt;hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="378171" data-lia-user-login="LuukP" class="lia-mention lia-mention-user"&gt;LuukP&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;try below&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Realized New Business =
sumx(
    filter(
       all('yourtablename'[client no]),
       _CP - _PP &amp;gt; 0
           )
    _CP - _PP 
     )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 26 Oct 2023 19:46:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499848#M134185</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-10-26T19:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Table Incorrect Total - Need help with HASONEFILTER</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499869#M134186</link>
      <description>&lt;P&gt;Thanks Dangar - unfortunately that didn't work.&amp;nbsp; The _CP and _PP variables are based on measures with filters, so I would need to preserve those filters.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 20:07:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499869#M134186</guid>
      <dc:creator>LuukP</dc:creator>
      <dc:date>2023-10-26T20:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Table Incorrect Total - Need help with HASONEFILTER</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499917#M134187</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="378171" data-lia-user-login="LuukP" class="lia-mention lia-mention-user"&gt;LuukP&lt;/a&gt;&amp;nbsp;Try using ALLSELECTED instead of ALL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also...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>Thu, 26 Oct 2023 20:55:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499917#M134187</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-10-26T20:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Table Incorrect Total - Need help with HASONEFILTER</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499938#M134188</link>
      <description>&lt;P&gt;Hi Greg - thanks for the feedback - that got me close, but there was nothing on the Total line...&amp;nbsp; I did look at your reference articles earlier and revisited them and did get it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My solution was this:&lt;/P&gt;&lt;P&gt;The measure I was struggling with I kept simple:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;Realized New Business =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;var _CP = [Realized New Business CP]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;var _PP = [Realized New Business PP]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;var _rnb = _CP-_PP&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;RETURN IF(_rnb &amp;lt; 0, 0, _rnb)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, I added a new measure:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;Total RNB =&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;IF(HASONEFILTER('tablename'[ID]), [Realized New Business], SUMX(VALUES('tablename'[ID]),[Realized New Business])&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I thought I could do it without adding another measure, but at least this did the trick - based on the articles you provided.&amp;nbsp; Thank you!!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 21:09:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-Incorrect-Total-Need-help-with-HASONEFILTER/m-p/3499938#M134188</guid>
      <dc:creator>LuukP</dc:creator>
      <dc:date>2023-10-26T21:09:24Z</dc:date>
    </item>
  </channel>
</rss>

