<?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: Calculate Subtotal From a Template - Finance in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Subtotal-From-a-Template-Finance/m-p/3319187#M124207</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="205599" data-lia-user-login="H_insight" class="lia-mention lia-mention-user"&gt;H_insight&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>Thu, 06 Jul 2023 21:54:38 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2023-07-06T21:54:38Z</dc:date>
    <item>
      <title>Calculate Subtotal From a Template - Finance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Subtotal-From-a-Template-Finance/m-p/3319178#M124206</link>
      <description>&lt;P&gt;Hiya,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a custom template (Disconnected table) inside power bi to help me deliver a business layout.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Template:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created the following measures:&lt;/P&gt;&lt;P&gt;Base measure:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Amount = SUM('FACT'[Value])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Amount measure for Plan &amp;amp; Actual:&lt;BR /&gt;Amount (,000) =&lt;/P&gt;&lt;P&gt;VAR _Actual = CALCULATE([Total Amount], 'FACT'[Plan] = "A")&lt;BR /&gt;VAR _Plan = CALCULATE([Total Amount], 'FACT'[Plan] = "P")&lt;/P&gt;&lt;P&gt;Return&lt;BR /&gt;IF(&lt;BR /&gt;SELECTEDVALUE('Custom View'[Type]) = "Actual", _Actual,&lt;BR /&gt;IF(SELECTEDVALUE('Custom View'[Type]) = "Plan", _Plan,&lt;BR /&gt;IF(SELECTEDVALUE('Custom View'[Type]) = "VAR", (_Plan - _Actual),0)))+0&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dynamic measure to get me values per selected (In month , YTD, Full Year)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dynamic Measure =&lt;BR /&gt;VAR _CurrentItem = SELECTEDVALUE(Template[SK])&lt;BR /&gt;VAR _Title = SELECTEDVALUE('Custom View'[Title])&lt;BR /&gt;VAR _Type = SELECTEDVALUE('Custom View'[Type])&lt;BR /&gt;VAR _InMonth = CALCULATE( [Amount (,000)], FILTER('FACT','FACT'[SK] = _CurrentItem))&lt;BR /&gt;VAR _category = SELECTEDVALUE(Template[Category])&lt;/P&gt;&lt;P&gt;VAR _YTD = CALCULATE(&lt;BR /&gt;[Amount (,000)],&lt;BR /&gt;FILTER(ALL('Calendar'), 'Calendar'[Date] IN DATESYTD('Calendar'[Date])),&lt;BR /&gt;'FACT'[SK] = _CurrentItem&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;VAR _FullYear = CALCULATE(&lt;BR /&gt;[Amount (,000)],&lt;BR /&gt;FILTER(ALL('Calendar'), 'Calendar'[Year] = SELECTEDVALUE('Calendar'[Year])),&lt;BR /&gt;'FACT'[SK]= _CurrentItem&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Return&lt;BR /&gt;SWITCH(TRUE(),&lt;BR /&gt;_Title = "In Month", _InMonth,&lt;BR /&gt;_Title = "YTD", _YTD,&lt;BR /&gt;_Title = "Full Year", _FullYear,&lt;BR /&gt;BLANK()&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The below matrix shows the correct values, but what I am struggling to get is the SubTotals per the layout.&lt;/P&gt;&lt;P&gt;i.e. "Finance Subtotal" = (SK1+SK2+SK3+SK4)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Missing Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached sample &lt;A href="https://we.tl/t-hu7slqGEx0" target="_self"&gt;PBIX File&amp;nbsp;&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 21:42:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Subtotal-From-a-Template-Finance/m-p/3319178#M124206</guid>
      <dc:creator>H_insight</dc:creator>
      <dc:date>2023-07-06T21:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Subtotal From a Template - Finance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Subtotal-From-a-Template-Finance/m-p/3319187#M124207</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="205599" data-lia-user-login="H_insight" class="lia-mention lia-mention-user"&gt;H_insight&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>Thu, 06 Jul 2023 21:54:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Subtotal-From-a-Template-Finance/m-p/3319187#M124207</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-07-06T21:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Subtotal From a Template - Finance</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Subtotal-From-a-Template-Finance/m-p/3319717#M124227</link>
      <description>&lt;P&gt;Thanks&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;BR /&gt;&lt;BR /&gt;It's remarkable to realize that this concept was initially proposed back in July 2018, and its 5 YEARS anniversary is fast approaching without any resolution in sight!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I see your approach of having "No Calculate", but for some reason, I am not able to apply it to my disconnected table. any chance you can provide the DAX code for me to explorer, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, here is my attempt:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;m_Total 4 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;__table&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SUMMARIZE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'FACT'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'FACT'&lt;/SPAN&gt;&lt;SPAN&gt;[SK]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'FACT'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'FACT'&lt;/SPAN&gt;&lt;SPAN&gt;[Plan]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"__value"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;[Total Amount]&lt;/SPAN&gt;&lt;SPAN&gt;)&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&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;HASONEVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Template&lt;/SPAN&gt;&lt;SPAN&gt;[SK]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;[Total Amount]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;__table&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;[__value]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;/SPAN&gt;but I am getting the same values everywhere, which is normal as there is no relationship between 'Template' and 'FACT' tables.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 07 Jul 2023 06:17:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Subtotal-From-a-Template-Finance/m-p/3319717#M124227</guid>
      <dc:creator>H_insight</dc:creator>
      <dc:date>2023-07-07T06:17:53Z</dc:date>
    </item>
  </channel>
</rss>

