<?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 subtotal to sum up associated values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4691253#M179636</link>
    <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would need some help in having subtotals sum up all the associated values as they are. Here is what I mean:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As you can see, my current Measure Target works by multiplying all the Sum of Target values with their respecitve Sum of Sales values. This is fine when it stays at the customer level (such as with customer 83 where 6.798.741€ * (1+0,03) = 7.002.703). However, my issue is that at the Customer Group level, it does exactly the same operation which, obivously, does not make any sense. Here, I would like to have the subtotal at each Customer Group level to be the sum of all Target values below. Hence, rather than having 183.303.557 for the Customer Group Retail, I would like to have&amp;nbsp;149.397.251 (=49447473 + 35982154 + 55502105 + 2861396 + 5604123).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The Measure Target looks as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Target = 

var sales=
sum(Sales[Sales])

var cal=
CALCULATE(
        sales * (1+sum(Customers[Target]))
    )


return cal&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data model is simply a customer table that includes the target per customer and a sales table with the actual sales and a FK linking it to the PK of the customer table.&lt;BR /&gt;&lt;BR /&gt;Can anyone therefore please point me to the right direction on how I can get the subtotal figure to behave in the way as described above? Or is this not so much a DAX task and more question of visuals settings?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If it it something that can be addressed with DAX, I am currently thinking about adding a&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Target = 

var sales=
sum(Sales[Sales])

var cal=
CALCULATE(
        sales * (1+sum(Customers[Target]))
    )

var swi=
SWITCH(
    TRUE(),
    ISINSCOPE(Customers[CustomerID]),
    cal,
    ISINSCOPE(Customers[CustomerGroup]),
    ????????
)

return swi&lt;/LI-CODE&gt;&lt;P&gt;to the DAX above. But I am not sure what to put in for ????????.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Tue, 13 May 2025 16:31:44 GMT</pubDate>
    <dc:creator>Thomas_San</dc:creator>
    <dc:date>2025-05-13T16:31:44Z</dc:date>
    <item>
      <title>subtotal to sum up associated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4691253#M179636</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would need some help in having subtotals sum up all the associated values as they are. Here is what I mean:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As you can see, my current Measure Target works by multiplying all the Sum of Target values with their respecitve Sum of Sales values. This is fine when it stays at the customer level (such as with customer 83 where 6.798.741€ * (1+0,03) = 7.002.703). However, my issue is that at the Customer Group level, it does exactly the same operation which, obivously, does not make any sense. Here, I would like to have the subtotal at each Customer Group level to be the sum of all Target values below. Hence, rather than having 183.303.557 for the Customer Group Retail, I would like to have&amp;nbsp;149.397.251 (=49447473 + 35982154 + 55502105 + 2861396 + 5604123).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The Measure Target looks as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Target = 

var sales=
sum(Sales[Sales])

var cal=
CALCULATE(
        sales * (1+sum(Customers[Target]))
    )


return cal&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data model is simply a customer table that includes the target per customer and a sales table with the actual sales and a FK linking it to the PK of the customer table.&lt;BR /&gt;&lt;BR /&gt;Can anyone therefore please point me to the right direction on how I can get the subtotal figure to behave in the way as described above? Or is this not so much a DAX task and more question of visuals settings?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If it it something that can be addressed with DAX, I am currently thinking about adding a&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Target = 

var sales=
sum(Sales[Sales])

var cal=
CALCULATE(
        sales * (1+sum(Customers[Target]))
    )

var swi=
SWITCH(
    TRUE(),
    ISINSCOPE(Customers[CustomerID]),
    cal,
    ISINSCOPE(Customers[CustomerGroup]),
    ????????
)

return swi&lt;/LI-CODE&gt;&lt;P&gt;to the DAX above. But I am not sure what to put in for ????????.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 16:31:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4691253#M179636</guid>
      <dc:creator>Thomas_San</dc:creator>
      <dc:date>2025-05-13T16:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: subtotal to sum up associated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4692836#M179702</link>
      <description>&lt;P&gt;I think this will work at any level of the hierarchy&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Target =
SUMX (
    Customer,
    VAR sales =
        CALCULATE ( SUM ( Sales[Sales] ) )
    VAR cal = sales * ( 1 + Customers[Target] )
    RETURN
        cal
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 May 2025 15:41:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4692836#M179702</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-05-14T15:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: subtotal to sum up associated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4693303#M179723</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/446448" target="_self"&gt;&lt;SPAN class=""&gt;Thomas_San&lt;/SPAN&gt;&lt;/A&gt;,&lt;BR /&gt;&lt;BR /&gt;I guess, your DAX expression does work at the customer scope but not at group scope.&lt;BR /&gt;Try below DAX:&lt;BR /&gt;Target =&lt;BR /&gt;SUMX(&lt;BR /&gt;VALUES( Customers[CustomerID] ), // ← iterate each customer in current filter context&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM( Sales[SalesAmt] ) * // ← that customer’s sales&lt;BR /&gt;( 1 + SUM( Customers[TargetPct] ) ) // ← times 1 + that customer’s target%&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;I am not sure, how data looks from your side as you haven't provided sample data to check the DAX expression.&lt;BR /&gt;It would be good to share sample data for testing the DAX expression.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too.&amp;nbsp;And if you found it useful, a quick "Kudos" is always appreciated, thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maruthi&amp;nbsp;&lt;/P&gt;&lt;P&gt;LinkedIn -&amp;nbsp;&lt;A href="http://www.linkedin.com/in/maruthi-siva-prasad/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.linkedin.com/in/maruthi-siva-prasad/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;X&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp;&amp;nbsp;&lt;A href="https://x.com/maruthisp" target="_blank" rel="nofollow noopener noreferrer"&gt;Maruthi Siva Prasad - (@MaruthiSP) / X&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 04:53:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4693303#M179723</guid>
      <dc:creator>maruthisp</dc:creator>
      <dc:date>2025-05-15T04:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: subtotal to sum up associated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4703621#M180152</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446448" data-lia-user-login="Thomas_San" class="lia-mention lia-mention-user"&gt;Thomas_San&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 12:52:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4703621#M180152</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-22T12:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: subtotal to sum up associated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4707575#M180292</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446448" data-lia-user-login="Thomas_San" class="lia-mention lia-mention-user"&gt;Thomas_San&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;I wanted to check if you had the opportunity to review the information provided by &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="526044" data-lia-user-login="maruthisp" class="lia-mention lia-mention-user"&gt;maruthisp&lt;/a&gt;&amp;nbsp; and &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp;. Please feel free to contact us if you have any further questions. If their response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.&lt;BR /&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 12:25:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4707575#M180292</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-26T12:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: subtotal to sum up associated values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4713878#M180551</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446448" data-lia-user-login="Thomas_San" class="lia-mention lia-mention-user"&gt;Thomas_San&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please &lt;STRONG&gt;Accept it as a solution&lt;/STRONG&gt; and give it a '&lt;STRONG&gt;Kudos&lt;/STRONG&gt;' so others can find it easily.&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 10:34:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/subtotal-to-sum-up-associated-values/m-p/4713878#M180551</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-30T10:34:41Z</dc:date>
    </item>
  </channel>
</rss>

