<?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 Dax for total row optimization in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-total-row-optimization/m-p/4845265#M184927</link>
    <description>&lt;P&gt;hi Guys,&lt;BR /&gt;&lt;BR /&gt;this is my DAX:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EffectivePrice Percentage = 
IF(ISINSCOPE(Fct_EA_AmortizedCosts[Discountability]) || ISINSCOPE(Fct_EA_AmortizedCosts[DiscountPlanName]) || ISINSCOPE(Fct_EA_AmortizedCosts[SubscriptionName]) || ISINSCOPE(Dim_EA_AmortizedCosts_Resources[ResourceType]),
    DIVIDE(
    SUMX(
        Fct_EA_AmortizedCosts,
        ('Fct_EA_AmortizedCosts'[EffectivePrice]) * ('Fct_EA_AmortizedCosts'[WeightInBillingCurrency])
    ),
    SUM('Fct_EA_AmortizedCosts'[WeightInBillingCurrency])
    ) / 100, 
    BLANK()
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;as you can see I am adding ISINSCOPE all the time when new page with new columns in matrix arrived in order to not show total row.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is there a possibility to optimize this DAX to be more generic?&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Jacek&lt;/P&gt;</description>
    <pubDate>Wed, 08 Oct 2025 08:23:50 GMT</pubDate>
    <dc:creator>jaryszek</dc:creator>
    <dc:date>2025-10-08T08:23:50Z</dc:date>
    <item>
      <title>Dax for total row optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-total-row-optimization/m-p/4845265#M184927</link>
      <description>&lt;P&gt;hi Guys,&lt;BR /&gt;&lt;BR /&gt;this is my DAX:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EffectivePrice Percentage = 
IF(ISINSCOPE(Fct_EA_AmortizedCosts[Discountability]) || ISINSCOPE(Fct_EA_AmortizedCosts[DiscountPlanName]) || ISINSCOPE(Fct_EA_AmortizedCosts[SubscriptionName]) || ISINSCOPE(Dim_EA_AmortizedCosts_Resources[ResourceType]),
    DIVIDE(
    SUMX(
        Fct_EA_AmortizedCosts,
        ('Fct_EA_AmortizedCosts'[EffectivePrice]) * ('Fct_EA_AmortizedCosts'[WeightInBillingCurrency])
    ),
    SUM('Fct_EA_AmortizedCosts'[WeightInBillingCurrency])
    ) / 100, 
    BLANK()
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;as you can see I am adding ISINSCOPE all the time when new page with new columns in matrix arrived in order to not show total row.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is there a possibility to optimize this DAX to be more generic?&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Jacek&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 08:23:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-total-row-optimization/m-p/4845265#M184927</guid>
      <dc:creator>jaryszek</dc:creator>
      <dc:date>2025-10-08T08:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dax for total row optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-total-row-optimization/m-p/4845349#M184930</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107617" data-lia-user-login="jaryszek" class="lia-mention lia-mention-user"&gt;jaryszek&lt;/a&gt;&amp;nbsp;If you want to show the measure only when a single value is selected for [Discountability], [DiscountPlanName], [SubscriptionName], or [ResourceType], you can do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;EffectivePrice Percentage = &lt;BR /&gt;IF(&lt;BR /&gt;HASONEVALUE(Fct_EA_AmortizedCosts[Discountability]) &lt;BR /&gt;|| HASONEVALUE(Fct_EA_AmortizedCosts[DiscountPlanName]) &lt;BR /&gt;|| HASONEVALUE(Fct_EA_AmortizedCosts[SubscriptionName]) &lt;BR /&gt;|| HASONEVALUE(Dim_EA_AmortizedCosts_Resources[ResourceType]),&lt;BR /&gt;DIVIDE(&lt;BR /&gt;SUMX(&lt;BR /&gt;Fct_EA_AmortizedCosts,&lt;BR /&gt;Fct_EA_AmortizedCosts[EffectivePrice] * Fct_EA_AmortizedCosts[WeightInBillingCurrency]&lt;BR /&gt;),&lt;BR /&gt;SUM(Fct_EA_AmortizedCosts[WeightInBillingCurrency])&lt;BR /&gt;) / 100,&lt;BR /&gt;BLANK()&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 09:47:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-total-row-optimization/m-p/4845349#M184930</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-10-08T09:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dax for total row optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-total-row-optimization/m-p/4845437#M184933</link>
      <description>&lt;P&gt;thanks,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;but still i need to provide field names, it is not generic.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 11:00:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-total-row-optimization/m-p/4845437#M184933</guid>
      <dc:creator>jaryszek</dc:creator>
      <dc:date>2025-10-08T11:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dax for total row optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-total-row-optimization/m-p/4846131#M184948</link>
      <description>&lt;P&gt;Thankyou,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;, for your response.&lt;BR /&gt;&lt;BR /&gt;Hi jaryszek,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;We appreciate your inquiry submitted through the Microsoft Fabric Community Forum.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Based on my understanding, DAX currently does not provide a built-in method to automatically detect which fields are used in a Matrix visual or to determine whether a cell represents a total or a subtotal. Functions such as ISINSCOPE(), HASONEVALUE(), and HASONEFILTER() operate on a per column basis and therefore require explicit column references. This behaviour is by design and does not indicate a product defect.&lt;/P&gt;
&lt;P&gt;DAX cannot generically detect totals without specifying columns. &lt;SPAN&gt;The helper measure pattern below is a best practice approach for long term maintainability and performance.&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;To simplify maintenance and optimise your measure, you can centralise all your ISINSCOPE() checks in a single helper measure or variable instead of repeating them:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;-- Helper measure (optional)&lt;BR /&gt;IsRowContext =&lt;BR /&gt;OR(&lt;BR /&gt;ISINSCOPE(Fct_EA_AmortizedCosts[Discountability]),&lt;BR /&gt;ISINSCOPE(Fct_EA_AmortizedCosts[DiscountPlanName]),&lt;BR /&gt;ISINSCOPE(Fct_EA_AmortizedCosts[SubscriptionName]),&lt;BR /&gt;ISINSCOPE(Dim_EA_AmortizedCosts_Resources[ResourceType])&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;-- Final measure&lt;BR /&gt;EffectivePrice Percentage =&lt;BR /&gt;VAR Numerator =&lt;BR /&gt;SUMX(&lt;BR /&gt;Fct_EA_AmortizedCosts,&lt;BR /&gt;Fct_EA_AmortizedCosts[EffectivePrice] * Fct_EA_AmortizedCosts[WeightInBillingCurrency]&lt;BR /&gt;)&lt;BR /&gt;VAR Denominator = SUM(Fct_EA_AmortizedCosts[WeightInBillingCurrency])&lt;BR /&gt;VAR WeightedAvg = DIVIDE(Numerator, Denominator) / 100&lt;BR /&gt;RETURN&lt;BR /&gt;IF([IsRowContext], WeightedAvg, BLANK())&lt;/P&gt;
&lt;P&gt;This approach ensures that you maintain only a single location (IsRowContext) if you add new columns later.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Alternatively, to hide totals visually, go to the Format pane, select Subtotals, and turn off Row or Column totals.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;We hope that the information provided will help to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric Community.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 04:46:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-total-row-optimization/m-p/4846131#M184948</guid>
      <dc:creator>v-pnaroju-msft</dc:creator>
      <dc:date>2025-10-09T04:46:48Z</dc:date>
    </item>
  </channel>
</rss>

