<?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 with filtered measures in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-filtered-measures/m-p/1040332#M13926</link>
    <description>&lt;P&gt;When placed in a large data set, the summarize method becomes a hefty task for BI and requires a long time for calculations to finish.&lt;/P&gt;&lt;P&gt;I have attempted to move the Summarize portion out into a calculated field and maintain the Sumx() part with no luck. The calculations returns accurately, but the subtotals sum the whole Table (Counttble) and do not filter. Is it possible to do this split of equation to help performance?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Counttbl = SUMMARIZE(DataTbl,DataTbl[EDATE],'Map'[ID],"__value",[CountSet2])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&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;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Measure:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CountSet =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;IF(HASONEVALUE('Map'[ID]),[CountSet2],SUMX('Counttbl',[__value]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calculation:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;CountSet2 = CALCULATE(DISTINCTCOUNT(DataTbl[rID]),FILTER(Calendar,Calendar[CALNDR_DT]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 22 Apr 2020 00:38:50 GMT</pubDate>
    <dc:creator>letherboi</dc:creator>
    <dc:date>2020-04-22T00:38:50Z</dc:date>
    <item>
      <title>Sum with filtered measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-filtered-measures/m-p/991414#M12324</link>
      <description>&lt;P&gt;Hello! I have a situation where I am using Calc(sum()) to sum filtered data and then subtract 40 from the result. The table has correct individual results, but is not rolling the sub total correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Equation:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var OT=(CALCULATE(sum(DataTbl[HRS])-40,DateTbl[DaysBack]&amp;lt;=7,DateTbl[DaysBack]&amp;gt;0))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if(OT&amp;gt;0,OT)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The above sums all hrs within 7 prior days and then subtracts 40 from the sum. I have taken a look at SUMX() but am not sure how I can incorporate the subtraction of 40 post sum and then find that total&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Example of Issue where Sub total should be 90:&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Sub Total&lt;/TD&gt;&lt;TD&gt;(170-40)=130&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Name 1&lt;/TD&gt;&lt;TD&gt;(60-40)=20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Name 2&lt;/TD&gt;&lt;TD&gt;(110-40)=70&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Mar 2020 16:17:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-filtered-measures/m-p/991414#M12324</guid>
      <dc:creator>letherboi</dc:creator>
      <dc:date>2020-03-25T16:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with filtered measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-filtered-measures/m-p/991463#M12328</link>
      <description>&lt;P&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;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 16:36:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-filtered-measures/m-p/991463#M12328</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-25T16:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with filtered measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-filtered-measures/m-p/991784#M12345</link>
      <description>&lt;P&gt;The BI you provided gave ample direction for my solution! It took some tweaking, but was able to configure once the understanding was established.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 20:50:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-filtered-measures/m-p/991784#M12345</guid>
      <dc:creator>letherboi</dc:creator>
      <dc:date>2020-03-25T20:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with filtered measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-filtered-measures/m-p/1040332#M13926</link>
      <description>&lt;P&gt;When placed in a large data set, the summarize method becomes a hefty task for BI and requires a long time for calculations to finish.&lt;/P&gt;&lt;P&gt;I have attempted to move the Summarize portion out into a calculated field and maintain the Sumx() part with no luck. The calculations returns accurately, but the subtotals sum the whole Table (Counttble) and do not filter. Is it possible to do this split of equation to help performance?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Counttbl = SUMMARIZE(DataTbl,DataTbl[EDATE],'Map'[ID],"__value",[CountSet2])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&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;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Measure:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CountSet =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;IF(HASONEVALUE('Map'[ID]),[CountSet2],SUMX('Counttbl',[__value]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calculation:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;CountSet2 = CALCULATE(DISTINCTCOUNT(DataTbl[rID]),FILTER(Calendar,Calendar[CALNDR_DT]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Apr 2020 00:38:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-with-filtered-measures/m-p/1040332#M13926</guid>
      <dc:creator>letherboi</dc:creator>
      <dc:date>2020-04-22T00:38:50Z</dc:date>
    </item>
  </channel>
</rss>

