<?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: Total for Top grouping in a matrix not calculating correctly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-for-Top-grouping-in-a-matrix-not-calculating-correctly/m-p/3300429#M123080</link>
    <description>&lt;P&gt;&lt;SPAN&gt;[TargetWholeNumber] =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimDate&lt;/SPAN&gt;&lt;SPAN&gt;[MonthName]&lt;/SPAN&gt;&lt;SPAN&gt;),&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;FIRSTNONBLANK&lt;/STRONG&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MeasureData&lt;/SPAN&gt;&lt;SPAN&gt;[Target]&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Using FIRSTNONBLANK you add only one value per month to the total. Thus, in the grand total rows, the total can only be the sum of one subcatrgory, not of all.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What about wrting&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[TargetWholeNumber] =&amp;nbsp;SUM(MeasureData[Target])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;instead?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2023 20:42:04 GMT</pubDate>
    <dc:creator>Martin_D</dc:creator>
    <dc:date>2023-06-23T20:42:04Z</dc:date>
    <item>
      <title>Total for Top grouping in a matrix not calculating correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-for-Top-grouping-in-a-matrix-not-calculating-correctly/m-p/3294521#M122694</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if someone can help me with the DAX for a Measure.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;I have a target field in a Matrix that doesn't seem to be calculating correctly.&amp;nbsp; See below&lt;BR /&gt;In the first level grouping the values are correct, but not in the top grouping or for the grand total.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The Target is a running total for the month grouped by Program, so should be the sum of all the Target values in the top level group and for the grand total.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The DAX I'm using is fairly simple.&amp;nbsp; Uses 2 measures.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[TargetWholeNumber] =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimDate&lt;/SPAN&gt;&lt;SPAN&gt;[MonthName]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;FIRSTNONBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MeasureData&lt;/SPAN&gt;&lt;SPAN&gt;[Target]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;This is the measure that I'm using in the matrix.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[TargetWholeNumberRunningTotal] =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;([TargetWholeNumber], &lt;/SPAN&gt;&lt;SPAN&gt;DATESYTD&lt;/SPAN&gt;&lt;SPAN&gt;(DimDate[DateValue], &lt;/SPAN&gt;&lt;SPAN&gt;"30/06"&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advise will be appreciated.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 04:33:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-for-Top-grouping-in-a-matrix-not-calculating-correctly/m-p/3294521#M122694</guid>
      <dc:creator>angelo2022</dc:creator>
      <dc:date>2023-06-21T04:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Total for Top grouping in a matrix not calculating correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-for-Top-grouping-in-a-matrix-not-calculating-correctly/m-p/3300429#M123080</link>
      <description>&lt;P&gt;&lt;SPAN&gt;[TargetWholeNumber] =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimDate&lt;/SPAN&gt;&lt;SPAN&gt;[MonthName]&lt;/SPAN&gt;&lt;SPAN&gt;),&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;FIRSTNONBLANK&lt;/STRONG&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MeasureData&lt;/SPAN&gt;&lt;SPAN&gt;[Target]&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Using FIRSTNONBLANK you add only one value per month to the total. Thus, in the grand total rows, the total can only be the sum of one subcatrgory, not of all.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What about wrting&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[TargetWholeNumber] =&amp;nbsp;SUM(MeasureData[Target])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;instead?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 20:42:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-for-Top-grouping-in-a-matrix-not-calculating-correctly/m-p/3300429#M123080</guid>
      <dc:creator>Martin_D</dc:creator>
      <dc:date>2023-06-23T20:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Total for Top grouping in a matrix not calculating correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-for-Top-grouping-in-a-matrix-not-calculating-correctly/m-p/3301546#M123161</link>
      <description>&lt;P&gt;Thanks for your reply, but using the Sum won't work.&amp;nbsp; &amp;nbsp;The target amount is repeated for each measure values. Using a sum will multiple the target amount.&amp;nbsp; &amp;nbsp;I just need to find a way to sum up the group values and grand total amount.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 04:20:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-for-Top-grouping-in-a-matrix-not-calculating-correctly/m-p/3301546#M123161</guid>
      <dc:creator>angelo2022</dc:creator>
      <dc:date>2023-06-26T04:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Total for Top grouping in a matrix not calculating correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-for-Top-grouping-in-a-matrix-not-calculating-correctly/m-p/3301626#M123175</link>
      <description>&lt;P&gt;What about setting a month filter on the visual in addition?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 05:45:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-for-Top-grouping-in-a-matrix-not-calculating-correctly/m-p/3301626#M123175</guid>
      <dc:creator>Martin_D</dc:creator>
      <dc:date>2023-06-26T05:45:57Z</dc:date>
    </item>
  </channel>
</rss>

