<?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 Help with DAX and SUMX, totals showing incorrectly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DAX-and-SUMX-totals-showing-incorrectly/m-p/3769743#M147231</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data model as shown in the below image, all directly or indirectly linked through a field called [%PLANT_MATERIAL].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The aim here is to create a matrix which shows the total demand 'APO Demand'[APO Demand] by week commencing at different levels of hierarchy (KNA1.NAME1 - Name 1, MARA.MSBOOKPARTNO - Family Group, MAKT.MAKTX - Material Description (Short Text) and MARA.MATNR - Material Number), however, depending on the work centre selected in the matrix or relevant chart in small multiples the value shown should take in to account the 'Work Centre'[UOM].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the relevant %PLANT_MATERIAL goes through a work centre which has a [UOM] of 'SH' then the volume should be divided by 'Material Model'[PZVC_CART.F_NUMBERUP - Box WIP No Up]. The model knows which work centre the material passes through based on the 'Routes' table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The struggle I am having is getting the total of each week commencing to correctly display, which is leading to the charts showing overall volume vs capacity not displaying correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the DAX I am currently using...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;APO Demand SH = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;('APO Demand'[APO Demand]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('Material Model'[PZVC_CART.F_NUMBERUP - Box WIP No Up])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RCCP Demand = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;('Material Model'[MARA.MSBOOKPARTNO - Family Group]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('Work Centre'[UOM]) = &lt;/SPAN&gt;&lt;SPAN&gt;"SH"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'APO Demand'[APO Demand SH],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;('APO Demand'[APO Demand])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance. O&lt;/P&gt;</description>
    <pubDate>Mon, 18 Mar 2024 01:47:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-03-18T01:47:57Z</dc:date>
    <item>
      <title>Help with DAX and SUMX, totals showing incorrectly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DAX-and-SUMX-totals-showing-incorrectly/m-p/3769743#M147231</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data model as shown in the below image, all directly or indirectly linked through a field called [%PLANT_MATERIAL].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The aim here is to create a matrix which shows the total demand 'APO Demand'[APO Demand] by week commencing at different levels of hierarchy (KNA1.NAME1 - Name 1, MARA.MSBOOKPARTNO - Family Group, MAKT.MAKTX - Material Description (Short Text) and MARA.MATNR - Material Number), however, depending on the work centre selected in the matrix or relevant chart in small multiples the value shown should take in to account the 'Work Centre'[UOM].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the relevant %PLANT_MATERIAL goes through a work centre which has a [UOM] of 'SH' then the volume should be divided by 'Material Model'[PZVC_CART.F_NUMBERUP - Box WIP No Up]. The model knows which work centre the material passes through based on the 'Routes' table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The struggle I am having is getting the total of each week commencing to correctly display, which is leading to the charts showing overall volume vs capacity not displaying correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the DAX I am currently using...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;APO Demand SH = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;('APO Demand'[APO Demand]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('Material Model'[PZVC_CART.F_NUMBERUP - Box WIP No Up])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RCCP Demand = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;('Material Model'[MARA.MSBOOKPARTNO - Family Group]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('Work Centre'[UOM]) = &lt;/SPAN&gt;&lt;SPAN&gt;"SH"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'APO Demand'[APO Demand SH],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;('APO Demand'[APO Demand])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance. O&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 01:47:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DAX-and-SUMX-totals-showing-incorrectly/m-p/3769743#M147231</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-18T01:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with DAX and SUMX, totals showing incorrectly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DAX-and-SUMX-totals-showing-incorrectly/m-p/3771160#M147311</link>
      <description>&lt;P&gt;It seems like you're trying to calculate demand based on different levels of hierarchy while considering the unit of measure (UOM) and adjusting the demand accordingly if it passes through a specific work center with UOM 'SH'. Here's how you can adjust your DAX measures to correctly calculate the total demand by week commencing:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;APO Demand SH&lt;/STRONG&gt;: This measure calculates the demand, taking into account the 'SH' unit of measure if applicable.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;APO Demand SH =&lt;BR /&gt;IF (&lt;BR /&gt;SELECTEDVALUE ( 'Work Centre'[UOM] ) = "SH",&lt;BR /&gt;DIVIDE (&lt;BR /&gt;SUM ( 'APO Demand'[APO Demand] ),&lt;BR /&gt;MAX ( 'Material Model'[PZVC_CART.F_NUMBERUP - Box WIP No Up] )&lt;BR /&gt;),&lt;BR /&gt;SUM ( 'APO Demand'[APO Demand] )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RCCP Demand&lt;/STRONG&gt;&lt;SPAN&gt;: This measure calculates the demand for each family group, considering whether it passes through a work center with UOM 'SH' or not.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RCCP Demand =&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( 'Material Model'[MARA.MSBOOKPARTNO - Family Group] ),&lt;BR /&gt;[APO Demand SH]&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Make sure to replace the measure [APO Demand SH] in the RCCP Demand measure with the adjusted version I provided above. This way, the RCCP Demand measure will sum up the demand correctly for each family group, considering the adjusted demand based on the unit of measure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 10:23:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DAX-and-SUMX-totals-showing-incorrectly/m-p/3771160#M147311</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-03-18T10:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with DAX and SUMX, totals showing incorrectly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DAX-and-SUMX-totals-showing-incorrectly/m-p/3781636#M147742</link>
      <description>&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;If these also don't help, please share more detailed information and description to help us clarify your scenario to test.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 06:53:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DAX-and-SUMX-totals-showing-incorrectly/m-p/3781636#M147742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-21T06:53:04Z</dc:date>
    </item>
  </channel>
</rss>

