<?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: TOTALYTD accumulating when it's not supposed to in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2997160#M101048</link>
    <description>&lt;P&gt;Frankly only thing which I have in mind is , that one of the "M" measures contains values. That would explain why you see some changes.&lt;BR /&gt;Otherwise try to debug the DEVIDE step by step.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jan 2023 17:56:54 GMT</pubDate>
    <dc:creator>Migasuke</dc:creator>
    <dc:date>2023-01-02T17:56:54Z</dc:date>
    <item>
      <title>TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996685#M101004</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello, I'm using the TOTALYTD quick measure to calculate the year-to-date cummulative value of my MTBF metric but when i have no MTBF values, I was expecting the MTBF (h) YTD stay the same, but instead it's showing me increasing values and I don't know why or where they come from, any clue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MTBF (h) YTD = 
TOTALYTD([MTBF (h)],'Calendar'[Date])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what's happening for my 'Calendar' [Date] selection&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 11:17:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996685#M101004</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-02T11:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996836#M101022</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt; ,&lt;BR /&gt;&lt;BR /&gt;I think the cause might be done by the expression in the other measure yoou have&lt;/P&gt;&lt;PRE&gt;[MTBF (h)]&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I used the same example with simple sum and everything works well:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 13:46:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996836#M101022</guid>
      <dc:creator>Migasuke</dc:creator>
      <dc:date>2023-01-02T13:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996886#M101027</link>
      <description>&lt;P&gt;I see, but in the example you have you're using the sum of values from a column, and I'm using a measure as the &lt;SPAN&gt;&amp;lt;expression&amp;gt;&amp;nbsp;&lt;/SPAN&gt;for TOTALYTD.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 14:12:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996886#M101027</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-02T14:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996912#M101028</link>
      <description>&lt;P&gt;Even If I switch my simple SUM with a measure (containing SUM), result is the same:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 14:24:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996912#M101028</guid>
      <dc:creator>Migasuke</dc:creator>
      <dc:date>2023-01-02T14:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996943#M101031</link>
      <description>&lt;P&gt;I don't know what I'm doing wrong then... My "MTBF(h)" is just a divide with a subtraction :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DIVIDE(
    [#M1] - [#M2] - [#M3] - [#M4],
    [#M5]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 14:38:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996943#M101031</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-02T14:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996988#M101036</link>
      <description>&lt;P&gt;How do you calculate M1, M2...?&lt;BR /&gt;&lt;BR /&gt;Example you have above should not make any problems.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 15:11:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2996988#M101036</guid>
      <dc:creator>Migasuke</dc:creator>
      <dc:date>2023-01-02T15:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2997013#M101037</link>
      <description>&lt;P&gt;They're all calculated in a similar way:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;M1 =
SUM(Table1[ColumnA])&lt;/LI-CODE&gt;&lt;P&gt;The rest are as like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# M2,M3,M4.. = 
CALCULATE(
    SUM(Table2[ColumnB]),
    'Table3'[ColumnC] in {'x','y','z'}
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 02 Jan 2023 15:21:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2997013#M101037</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-02T15:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2997160#M101048</link>
      <description>&lt;P&gt;Frankly only thing which I have in mind is , that one of the "M" measures contains values. That would explain why you see some changes.&lt;BR /&gt;Otherwise try to debug the DEVIDE step by step.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 17:56:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2997160#M101048</guid>
      <dc:creator>Migasuke</dc:creator>
      <dc:date>2023-01-02T17:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2997481#M101064</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I test the DIVIDE() function, in my side , when i use the TOTALYTD() function, it return the same as yours.&lt;/P&gt;
&lt;P&gt;For this , you can try to use this method:&lt;BR /&gt;(1)This is my test data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2)I create a measure as [MTBF(h)] like you:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MTBF (h) = DIVIDE( SUM('Table'[Column2]) - SUM('Table'[Column1]) , SUM('Table'[Column3]))&lt;/LI-CODE&gt;
&lt;P&gt;(3)We can create a measure like this to get the right YTD value:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;test = var _cur_date = MAX('Calendar'[Date])
var _t = SUMMARIZE(ALL('Calendar') , 'Calendar'[Date] , "MTBF (h)", [MTBF (h)])
var _t2 = FILTER( _t , [Date]&amp;lt;=_cur_date &amp;amp;&amp;amp; YEAR([Date]) = YEAR(_cur_date))
return
SUMX(_t2,[MTBF (h)])&lt;/LI-CODE&gt;
&lt;P&gt;(4)Then we can put the fields we need on the visual and we can meet your need:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 02:38:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2997481#M101064</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2023-01-03T02:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2998297#M101117</link>
      <description>&lt;P&gt;Thank you so much for your help, but does that mean the TOTALYTD does not work if I use the DIVIDE()?&amp;nbsp; I have another measure similar to MTBF that usess DIVIDE and the TOTALYTD there is working as I expected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 10:18:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2998297#M101117</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-03T10:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: TOTALYTD accumulating when it's not supposed to</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2999688#M101227</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh, sorry for not detailed explanation. Not for all the DIVIDE() function is not support for the TOTALYTD() function, just when the denominator is not dynamic. If the denominator is static , it works good,like this:&lt;/P&gt;
&lt;P&gt;test2 = TOTALYTD([MTBF (h)],'Calendar'[Date])&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For this reason, the actual logic is like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE(DIVIDE( SUM('Table'[Column2]) - SUM('Table'[Column1]) , 2) ,  DATESYTD('Date'[Date])  )

&lt;/LI-CODE&gt;
&lt;P&gt;If the denominators are different, then in different filtering contexts, the sum will not be performed but the average will be performed.&lt;/P&gt;
&lt;P&gt;And the bottom layer of TOTAL YTD() is also implemented using the FILTER () function, so it is recommended that you use the above method for some special cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2023 01:16:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOTALYTD-accumulating-when-it-s-not-supposed-to/m-p/2999688#M101227</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2023-01-04T01:16:21Z</dc:date>
    </item>
  </channel>
</rss>

