<?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: Better Running Total in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/2759226#M888</link>
    <description>&lt;P&gt;Thanks for sharing the pbix file Greg! I vouch for version Better RT 2, since it's rare for me working in Power BI without a data model.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Sep 2022 01:57:34 GMT</pubDate>
    <dc:creator>cabc_xlorla</dc:creator>
    <dc:date>2022-09-10T01:57:34Z</dc:date>
    <item>
      <title>Better Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/2755666#M885</link>
      <description>&lt;P&gt;Microsoft's running total quick measure, well, it's just not very good. It's overly complex and doesn't work in single table situations. There's a better way as shown in this video:&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=meh3OkgFYfc&amp;amp;t=3s" target="_blank" rel="noopener"&gt;MSHGQM - Don't Use CALCULATE! - YouTube&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, Microsoft's running total quick measure generates code such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Value running total in Date = 
CALCULATE(
	SUM('Table'[Value]),
	FILTER(
		ALLSELECTED('Table'[Date]),
		ISONORAFTER('Table'[Date], MAX('Table'[Date]), DESC)
	)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As shown, this running total doesn't work in single table situations. A better, less complex way to create a running total that works with a single table is like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Better RT = 
    VAR __Date = MAX('Table'[Date])
    VAR __Table = FILTER(ALLSELECTED('Table'),[Date] &amp;lt;= __Date)
RETURN
    SUMX(__Table,[Value])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And with just a minor change, this method also works if you have a separate Dates table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Better RT 2 = 
    VAR __Date = MAX('Dates'[Date])
    VAR __Table = FILTER(ALLSELECTED('Table'),[Date] &amp;lt;= __Date)
RETURN
    SUMX(__Table,[Value])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Watch the video!&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="https://youtu.be/meh3OkgFYfc" data-video-remote-vid="https://youtu.be/meh3OkgFYfc" class="lia-video-container lia-media-is-center lia-media-size-medium"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fmeh3OkgFYfc%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dmeh3OkgFYfc&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fmeh3OkgFYfc%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiMTcxZWJiZmEtZDdiMy00YWYyLWEyOTYtMmI1MDQ4YjlmMTY5IiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2022 12:14:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/2755666#M885</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-10-09T12:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Better Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/2759226#M888</link>
      <description>&lt;P&gt;Thanks for sharing the pbix file Greg! I vouch for version Better RT 2, since it's rare for me working in Power BI without a data model.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 01:57:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/2759226#M888</guid>
      <dc:creator>cabc_xlorla</dc:creator>
      <dc:date>2022-09-10T01:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Better Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/3503595#M1025</link>
      <description>&lt;P&gt;Thanks so much! I have been struggling with this measure for what feels like dayssss!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 02:31:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/3503595#M1025</guid>
      <dc:creator>rosiebilton23</dc:creator>
      <dc:date>2023-10-30T02:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Better Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/3899165#M1084</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;Thank you for this file&lt;BR /&gt;I just added one extra column DAY. I placed on page 2 of the attached file. and Total is not correct.&lt;BR /&gt;I am facing same error on my main file. Your support will be great.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 13:44:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/3899165#M1084</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-07T13:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Better Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/3899296#M1085</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;See reply in original thread.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 14:30:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Running-Total/m-p/3899296#M1085</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-05-07T14:30:31Z</dc:date>
    </item>
  </channel>
</rss>

