<?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 Dynamic grand total problem depending on switch selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3124988#M110965</link>
    <description>&lt;H5&gt;Hello community,&lt;/H5&gt;&lt;H5&gt;I'm unsuccessfully trying to show the dynamic Grand Total as the sum of the columns depending on whether or not I select the "Scenario" filter to show more measures.&lt;BR /&gt;If I select one measure the total appears&lt;/H5&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;H5&gt;but if I select two or more selections it does not appear&lt;/H5&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;H5&gt;The reason is that the measures do not talk to each other using the "Scenario" selector which is detached from the model and is used within the measures via the SWITCH function.&amp;nbsp;&lt;BR /&gt;I insert the measure, for simplicity I remove some scenarios&lt;/H5&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;Sum_Scenario_Year = &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//example of recalled measures&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//ACT CY = CALCULATE(SUM('CAPEX FOR ENG'[SCENARIO_VALUE]),'CAPEX FOR ENG'[SCENARIO] = "ACT" , DATESYTD(TIME[Date]))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// ACT - 1 = CALCULATE(SUM('CAPEX FOR ENG'[SCENARIO_VALUE]),'CAPEX FOR ENG'[SCENARIO] = "ACT" , DATEADD(DATESYTD(TIME[Date]), -1, YEAR))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// PCL CY = CALCULATE(SUM('CAPEX FOR ENG'[SCENARIO_VALUE]),'CAPEX FOR ENG'[SCENARIO] = "PCL" , DATESYTD(TIME[Date]))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; Scenario_value =&lt;/SPAN&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;('MAIN BASELINE'[MAIN BASELINE]),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"ACT CY"&lt;/SPAN&gt;&lt;SPAN&gt; , [ACT CY],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"ACT -1"&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;nbsp;[ACT -1],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"PCL CY"&lt;/SPAN&gt;&lt;SPAN&gt; , [PCL CY],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scenario_value&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;H5&gt;&lt;SPAN&gt;I tried to insert a logic for the total but it takes the sum of all the measures without distinction from the selected ones&lt;BR /&gt;&lt;/SPAN&gt;&lt;/H5&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;//if (hasonevalue('MAIN BASELINE'[MAIN BASELINE]),Scenario_value , &amp;nbsp;[ACT CY]+[ACT -1]+[ACT -2]+[ACT -3]+[FCT CY]+[BDG CY]+[PCL CY]+[EST CY]+[CMT CY]+[FTR + 1]+[FTR + 2]+[FTR + 3]+[FTR + 4]+[FTR + 5])&lt;/SPAN&gt;&lt;/PRE&gt;&lt;H5&gt;The model involved is this one&lt;/H5&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;H4&gt;&lt;SPAN&gt;I am not sure if this is possible, but any help regarding this issue is greatly appreciated! Thank you in advance!&lt;/SPAN&gt;&lt;BR /&gt;FEST&lt;/H4&gt;</description>
    <pubDate>Fri, 10 Mar 2023 19:44:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-03-10T19:44:29Z</dc:date>
    <item>
      <title>Dynamic grand total problem depending on switch selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3124988#M110965</link>
      <description>&lt;H5&gt;Hello community,&lt;/H5&gt;&lt;H5&gt;I'm unsuccessfully trying to show the dynamic Grand Total as the sum of the columns depending on whether or not I select the "Scenario" filter to show more measures.&lt;BR /&gt;If I select one measure the total appears&lt;/H5&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;H5&gt;but if I select two or more selections it does not appear&lt;/H5&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;H5&gt;The reason is that the measures do not talk to each other using the "Scenario" selector which is detached from the model and is used within the measures via the SWITCH function.&amp;nbsp;&lt;BR /&gt;I insert the measure, for simplicity I remove some scenarios&lt;/H5&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;Sum_Scenario_Year = &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//example of recalled measures&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//ACT CY = CALCULATE(SUM('CAPEX FOR ENG'[SCENARIO_VALUE]),'CAPEX FOR ENG'[SCENARIO] = "ACT" , DATESYTD(TIME[Date]))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// ACT - 1 = CALCULATE(SUM('CAPEX FOR ENG'[SCENARIO_VALUE]),'CAPEX FOR ENG'[SCENARIO] = "ACT" , DATEADD(DATESYTD(TIME[Date]), -1, YEAR))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// PCL CY = CALCULATE(SUM('CAPEX FOR ENG'[SCENARIO_VALUE]),'CAPEX FOR ENG'[SCENARIO] = "PCL" , DATESYTD(TIME[Date]))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; Scenario_value =&lt;/SPAN&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;('MAIN BASELINE'[MAIN BASELINE]),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"ACT CY"&lt;/SPAN&gt;&lt;SPAN&gt; , [ACT CY],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"ACT -1"&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;nbsp;[ACT -1],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"PCL CY"&lt;/SPAN&gt;&lt;SPAN&gt; , [PCL CY],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scenario_value&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;H5&gt;&lt;SPAN&gt;I tried to insert a logic for the total but it takes the sum of all the measures without distinction from the selected ones&lt;BR /&gt;&lt;/SPAN&gt;&lt;/H5&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;//if (hasonevalue('MAIN BASELINE'[MAIN BASELINE]),Scenario_value , &amp;nbsp;[ACT CY]+[ACT -1]+[ACT -2]+[ACT -3]+[FCT CY]+[BDG CY]+[PCL CY]+[EST CY]+[CMT CY]+[FTR + 1]+[FTR + 2]+[FTR + 3]+[FTR + 4]+[FTR + 5])&lt;/SPAN&gt;&lt;/PRE&gt;&lt;H5&gt;The model involved is this one&lt;/H5&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;H4&gt;&lt;SPAN&gt;I am not sure if this is possible, but any help regarding this issue is greatly appreciated! Thank you in advance!&lt;/SPAN&gt;&lt;BR /&gt;FEST&lt;/H4&gt;</description>
      <pubDate>Fri, 10 Mar 2023 19:44:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3124988#M110965</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-10T19:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic grand total problem depending on switch selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3125206#M110984</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Change return like &lt;/P&gt;
&lt;P&gt;Sumx( values('MAIN BASELINE'[MAIN BASELINE]), Scenario_value)&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 01:16:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3125206#M110984</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-03-11T01:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic grand total problem depending on switch selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3125450#M111000</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried as you indicated but I still don't see the total when I have two scenarios &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FEST&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 12:57:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3125450#M111000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-11T12:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic grand total problem depending on switch selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3125456#M111004</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please try&lt;/P&gt;
&lt;P&gt;Sum_Scenario_Year =&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( 'MAIN BASELINE'[MAIN BASELINE] ),&lt;BR /&gt;SWITCH (&lt;BR /&gt;'MAIN BASELINE'[MAIN BASELINE],&lt;BR /&gt;"ACT CY", [ACT CY],&lt;BR /&gt;"ACT -1", [ACT -1],&lt;BR /&gt;"PCL CY", [PCL CY]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 13:18:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3125456#M111004</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-11T13:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic grand total problem depending on switch selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3125486#M111008</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It works!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for both resolution suggestions&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;FEST&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 14:03:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-grand-total-problem-depending-on-switch-selection/m-p/3125486#M111008</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-11T14:03:34Z</dc:date>
    </item>
  </channel>
</rss>

