<?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: Matrix subtotal showing incorrect totals when using TREATAS() to map Allocation Units per employee in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-subtotal-showing-incorrect-totals-when-using-TREATAS-to/m-p/5142816#M187563</link>
    <description>&lt;P&gt;Solution: This error is usually not related to DAX or report logic -&lt;BR /&gt;it’s a temporary Power BI Service issue. It can happen due to session timeout, dataset connectivity issues, or sometimes just a backend glitch.&lt;BR /&gt;&lt;STRONG&gt;Quick things to try:&lt;BR /&gt;&lt;/STRONG&gt;* Refresh the page or open in Incognito.&lt;BR /&gt;* Logout and login again.&lt;BR /&gt;* Try a different browser.&lt;BR /&gt;If it still doesn’t work, then check:&lt;BR /&gt;* Dataset refresh / credentials&lt;BR /&gt;* Workspace access or permissions&lt;BR /&gt;If the issue continues, share the Exception ID with your admin - they can trace it from backend logs.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2026 06:05:43 GMT</pubDate>
    <dc:creator>Ray_Minds</dc:creator>
    <dc:date>2026-04-02T06:05:43Z</dc:date>
    <item>
      <title>Matrix subtotal showing incorrect totals when using TREATAS() to map Allocation Units per employee</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-subtotal-showing-incorrect-totals-when-using-TREATAS-to/m-p/5139834#M187512</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am working on a Power BI matrix visual where I need to display Allocation Units per employee and also show correct subtotals at the department level and grand total level.&lt;/P&gt;&lt;H3&gt;Matrix Structure&lt;/H3&gt;&lt;P&gt;Rows:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;DepartmentName&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;EmployeeName&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Values:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Allocation Units (measure)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;Tables Used&lt;/H3&gt;&lt;P&gt;Table 1: Activity_Log_Table&lt;BR /&gt;Contains:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;DepartmentName&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;EmployeeName&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Table 2: Resource_Allocation_Table&lt;BR /&gt;Contains:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;StaffFullName&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;AllocationUnits&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There is &lt;STRONG&gt;no direct relationship&lt;/STRONG&gt; between these tables, so I am using TREATAS() to map EmployeeName with StaffFullName.&lt;/P&gt;&lt;H3&gt;Current Measure&lt;/H3&gt;&lt;P&gt;Allocation Units Measure =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX('Resource_Allocation_Table'[AllocationUnits]),&lt;BR /&gt;TREATAS(&lt;BR /&gt;VALUES('Activity_Log_Table'[EmployeeName]),&lt;BR /&gt;'Resource_Allocation_Table'[StaffFullName]&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;H3&gt;Problem&lt;/H3&gt;&lt;P&gt;The measure returns correct values at the EmployeeName level, but:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;DepartmentName subtotal is incorrect&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Grand total is incorrect&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Power BI recalculates totals instead of summing visible rows&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;Expected Behaviour&lt;/H3&gt;&lt;P&gt;I want the matrix totals to behave like Excel-style aggregation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Show correct allocation units per EmployeeName&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Show subtotal per DepartmentName as sum of EmployeeName values&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Show correct grand total as sum of all EmployeeName values&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Avoid duplicate counting when EmployeeName appears multiple times&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;Sample Data&lt;/H3&gt;&lt;P&gt;Activity_Log_Table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;DepartmentName&lt;/TD&gt;&lt;TD&gt;EmployeeName&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Orion&lt;/TD&gt;&lt;TD&gt;Alex M&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Orion&lt;/TD&gt;&lt;TD&gt;Nina P&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Orion&lt;/TD&gt;&lt;TD&gt;Kevin L&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Nova&lt;/TD&gt;&lt;TD&gt;Daniel R&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Nova&lt;/TD&gt;&lt;TD&gt;Sophia T&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Resource_Allocation_Table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/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;&lt;/TD&gt;&lt;TD&gt;80&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Nova&lt;/TD&gt;&lt;TD&gt;Daniel R&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Nova&lt;/TD&gt;&lt;TD&gt;Sophia T&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Nova Total&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;55&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Grand Total&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;135&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Currently, subtotals and grand totals are not matching the expected summed values.&lt;/P&gt;&lt;P&gt;What is the correct DAX approach to ensure totals aggregate properly when using TREATAS() inside a matrix visual?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SBC&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2026 03:46:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-subtotal-showing-incorrect-totals-when-using-TREATAS-to/m-p/5139834#M187512</guid>
      <dc:creator>SBC</dc:creator>
      <dc:date>2026-03-27T03:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix subtotal showing incorrect totals when using TREATAS() to map Allocation Units per employee</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-subtotal-showing-incorrect-totals-when-using-TREATAS-to/m-p/5139863#M187513</link>
      <description>&lt;P class=""&gt;&lt;SPAN&gt;Thanks Everyone, I was able to resolve the issue by modifying the measure so that totals are calculated using an explicit row-level aggregation instead of relying on the default evaluation context inside the matrix visual.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;The problem occurred because the matrix subtotal and grand total were being recalculated rather than summing the visible employee-level values when using TREATAS().&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;Below is the working solution:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Allocation Units Measure =&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SUMX(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SUMMARIZE(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATETABLE(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Resource_Allocation_Table',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TREATAS(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VALUES('Activity_Log_Table'&lt;SPAN class=""&gt;[EmployeeName]&lt;/SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Resource_Allocation_Table'&lt;SPAN class=""&gt;[StaffFullName]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Resource_Allocation_Table'&lt;SPAN class=""&gt;[StaffFullName]&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Resource_Allocation_Table'&lt;SPAN class=""&gt;[AllocationUnits]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'Resource_Allocation_Table'&lt;SPAN class=""&gt;[AllocationUnits]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;After applying this logic, both department-level subtotals and the overall total are now aggregating correctly in the matrix visual.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sharing this here in case it helps others facing similar subtotal issues when using TREATAS().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SBC&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2026 05:29:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-subtotal-showing-incorrect-totals-when-using-TREATAS-to/m-p/5139863#M187513</guid>
      <dc:creator>SBC</dc:creator>
      <dc:date>2026-03-27T05:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix subtotal showing incorrect totals when using TREATAS() to map Allocation Units per employee</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-subtotal-showing-incorrect-totals-when-using-TREATAS-to/m-p/5139895#M187514</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="364794" data-lia-user-login="SBC" class="lia-mention lia-mention-user"&gt;SBC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fixed measure&lt;/P&gt;
&lt;PRE&gt;Allocation Units = &lt;BR /&gt;SUMX(&lt;BR /&gt;VALUES('Activity_Log_Table'[EmployeeName]),&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX('Resource_Allocation_Table'[AllocationUnits]),&lt;BR /&gt;TREATAS(&lt;BR /&gt;'Activity_Log_Table'[EmployeeName],&lt;BR /&gt;'Resource_Allocation_Table'[StaffFullName]&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Test it - subtotals match expected exactly&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2026 06:53:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-subtotal-showing-incorrect-totals-when-using-TREATAS-to/m-p/5139895#M187514</guid>
      <dc:creator>Kedar_Pande</dc:creator>
      <dc:date>2026-03-27T06:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix subtotal showing incorrect totals when using TREATAS() to map Allocation Units per employee</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-subtotal-showing-incorrect-totals-when-using-TREATAS-to/m-p/5142816#M187563</link>
      <description>&lt;P&gt;Solution: This error is usually not related to DAX or report logic -&lt;BR /&gt;it’s a temporary Power BI Service issue. It can happen due to session timeout, dataset connectivity issues, or sometimes just a backend glitch.&lt;BR /&gt;&lt;STRONG&gt;Quick things to try:&lt;BR /&gt;&lt;/STRONG&gt;* Refresh the page or open in Incognito.&lt;BR /&gt;* Logout and login again.&lt;BR /&gt;* Try a different browser.&lt;BR /&gt;If it still doesn’t work, then check:&lt;BR /&gt;* Dataset refresh / credentials&lt;BR /&gt;* Workspace access or permissions&lt;BR /&gt;If the issue continues, share the Exception ID with your admin - they can trace it from backend logs.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2026 06:05:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-subtotal-showing-incorrect-totals-when-using-TREATAS-to/m-p/5142816#M187563</guid>
      <dc:creator>Ray_Minds</dc:creator>
      <dc:date>2026-04-02T06:05:43Z</dc:date>
    </item>
  </channel>
</rss>

