<?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 TOTALS INCORRECT WHEN USING MAXX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALS-INCORRECT-WHEN-USING-MAXX/m-p/2137329#M49081</link>
    <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just need help calculating dynamic totals within Power BI for the following measure shown below .&amp;nbsp; Essentially, I am calculating the last recorded Average Cost and QTY On Hand across my 3 branches for a specific product ( TXWHSE) to get my Inventory Value.&amp;nbsp; But by&amp;nbsp; using MAXX I know why my totals are based on the MAXX value but my desired output is to SUM the total inventory Values across all 3 of my branches as my total amount.&amp;nbsp; In this case, it should show $52,455.15 .&amp;nbsp; How would I go about doing that ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Oct 2021 12:23:30 GMT</pubDate>
    <dc:creator>cdawidow</dc:creator>
    <dc:date>2021-10-15T12:23:30Z</dc:date>
    <item>
      <title>TOTALS INCORRECT WHEN USING MAXX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALS-INCORRECT-WHEN-USING-MAXX/m-p/2137329#M49081</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just need help calculating dynamic totals within Power BI for the following measure shown below .&amp;nbsp; Essentially, I am calculating the last recorded Average Cost and QTY On Hand across my 3 branches for a specific product ( TXWHSE) to get my Inventory Value.&amp;nbsp; But by&amp;nbsp; using MAXX I know why my totals are based on the MAXX value but my desired output is to SUM the total inventory Values across all 3 of my branches as my total amount.&amp;nbsp; In this case, it should show $52,455.15 .&amp;nbsp; How would I go about doing that ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 12:23:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALS-INCORRECT-WHEN-USING-MAXX/m-p/2137329#M49081</guid>
      <dc:creator>cdawidow</dc:creator>
      <dc:date>2021-10-15T12:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALS INCORRECT WHEN USING MAXX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALS-INCORRECT-WHEN-USING-MAXX/m-p/2138311#M49106</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;INVENTORY VALUE =
VAR LASTQ0H =
    CALCULATE (
        MAXX ( INTRAN00, INTRAN00[TXQOH] ),
        LASTDATE ( INTRAN00[TRANSACTION DATE] )
    )
VAR LASTAVGCOST =
    CALCULATE (
        MAXX ( INTRAN00, INTRAN00[NEW AC PER] ),
        LASTDATE ( INTRAN00[TRANSACTION DATE] )
    )
VAR MYTABLE =
    SUMMARIZE (
        INTRAN00,
        INTRAN00[TXWHSE],
        "LastQ0H",
            CALCULATE (
                MAXX ( INTRAN00, INTRAN00[TXQOH] ),
                LASTDATE ( INTRAN00[TRANSACTION DATE] )
            ),
        "LastAvgCost",
            CALCULATE (
                MAXX ( INTRAN00, INTRAN00[NEW AC PER] ),
                LASTDATE ( INTRAN00[TRANSACTION DATE] )
            )
    )
RETURN
    IF (
        HASONEVALUE ( INTRAN00[TXWHSE] ),
        LASTAVGCOST * LASTQ0H,
        SUMX ( MYTABLE, [LastAvgCost] * [LastQ0H] )
    )&lt;/LI-CODE&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sat, 16 Oct 2021 07:11:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALS-INCORRECT-WHEN-USING-MAXX/m-p/2138311#M49106</guid>
      <dc:creator>Jos_Woolley</dc:creator>
      <dc:date>2021-10-16T07:11:57Z</dc:date>
    </item>
  </channel>
</rss>

