<?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: Cumulative Totals in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945426#M10298</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="208944" data-lia-user-login="JamesGordon" class="lia-mention lia-mention-user"&gt;JamesGordon&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i think you can use much more simple version&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative test = CALCULATE(SUM('Sheet (2)'[Total Sell]), 'Sheet (2)'[Status] = "S", 'Sheet (2)'[Total Cost]&amp;gt;100 , 'Sheet (2)'[Inv date]&amp;lt;=MAX('Sheet (2)'[Inv date]) )&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 24 Feb 2020 15:45:59 GMT</pubDate>
    <dc:creator>az38</dc:creator>
    <dc:date>2020-02-24T15:45:59Z</dc:date>
    <item>
      <title>Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945402#M10295</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am struggling to calculate cumulative totals. Hopefully someone can help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a measure that i have created to calculate the total value of sales YTD (fromt Oct 2019 to today) - this is the measure i am basing my cumulative totals off if possible? (FYI this measure works for calculating YTD sales value)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total All Sales YTD = CALCULATE(SUM('Sheet (2)'[Total Sell]), FILTER('Sheet (2)', 'Sheet (2)'[Status] = "S"), filter('Sheet (2)', 'Sheet (2)'[Total Cost]&amp;gt;100))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am looking to use this measure as the basis for my cumulative totals to ensure it uses the correct values. I have tried to add the ALL filter as per previous &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;posts to start the cumulative values but having no luck.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Here is the measure i have tried to create but get the below error:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cumulative test = CALCULATE(SUM('Sheet (2)'[Total Sell]), FILTER('Sheet (2)', 'Sheet (2)'[Status] = "S"), filter('Sheet (2)', 'Sheet (2)'[Total Cost]&amp;gt;100),all('Sheet (2)'[Inv date].[Date])&amp;lt;=MAX('Sheet (2)'[Inv date].[Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Am i on the right track or completely off course?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Feb 2020 15:32:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945402#M10295</guid>
      <dc:creator>JamesGordon</dc:creator>
      <dc:date>2020-02-24T15:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945426#M10298</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="208944" data-lia-user-login="JamesGordon" class="lia-mention lia-mention-user"&gt;JamesGordon&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i think you can use much more simple version&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative test = CALCULATE(SUM('Sheet (2)'[Total Sell]), 'Sheet (2)'[Status] = "S", 'Sheet (2)'[Total Cost]&amp;gt;100 , 'Sheet (2)'[Inv date]&amp;lt;=MAX('Sheet (2)'[Inv date]) )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Feb 2020 15:45:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945426#M10298</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2020-02-24T15:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945442#M10301</link>
      <description>&lt;P&gt;Thanks Az38,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried your suggestion but get the following error?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 15:50:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945442#M10301</guid>
      <dc:creator>JamesGordon</dc:creator>
      <dc:date>2020-02-24T15:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945460#M10306</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="208944" data-lia-user-login="JamesGordon" class="lia-mention lia-mention-user"&gt;JamesGordon&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you did not use my suggestion, i see a lot of filters in your statement&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 15:56:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945460#M10306</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2020-02-24T15:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945475#M10308</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative test =
var __maxDate = MAX ( 'Sheet (2)'[Inv date] )
var __minCost = 100
var __status = "S"
return
CALCULATE (
    SUM ( 'Sheet (2)'[Total Sell] ),
    keepfilters('Sheet (2)'[Status] = __status),
    keepfilters('Sheet (2)'[Total Cost] &amp;gt; __minCost),
    'Sheet (2)'[Inv date] &amp;lt;= __maxDate
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Copy this as is. No changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 16:05:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945475#M10308</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T16:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945478#M10310</link>
      <description>&lt;P&gt;Hi Az38,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apolagies, I have now removed the filters and directly copied and pasted your suggestion but still getting the same error in regards the MAX function&lt;/P&gt;&lt;P&gt;"A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed."&lt;/P&gt;&lt;P&gt;Is there another function I should be using instead?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 16:03:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945478#M10310</guid>
      <dc:creator>JamesGordon</dc:creator>
      <dc:date>2020-02-24T16:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945482#M10312</link>
      <description>Mate, MAX can't be used in this context. Copy and paste my function.&lt;BR /&gt;&lt;BR /&gt;Bets&lt;BR /&gt;D</description>
      <pubDate>Mon, 24 Feb 2020 16:06:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945482#M10312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T16:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945510#M10314</link>
      <description>&lt;P&gt;Hi D,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your DAX - that is working with no errors.&lt;/P&gt;&lt;P&gt;However my graph is still presenting the data on a Monthly basis and not accumulating? I am using the Inv Date as the X-axis and your DAX as the measure - or am i missing a step?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 16:19:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945510#M10314</guid>
      <dc:creator>JamesGordon</dc:creator>
      <dc:date>2020-02-24T16:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945556#M10317</link>
      <description>What's in [Inv Date]? Do you have dates in there? I mean, not text looking as a date but real dates? Date data type?&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 24 Feb 2020 16:44:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945556#M10317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T16:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945562#M10318</link>
      <description>&lt;P&gt;I would say i have text that looks like dates.&lt;/P&gt;&lt;P&gt;By your comment i am guessing i need to create a date data type? If so how would you recommend the best way forward?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 16:46:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945562#M10318</guid>
      <dc:creator>JamesGordon</dc:creator>
      <dc:date>2020-02-24T16:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945563#M10319</link>
      <description>By the way... Why do I see the names of months? Are these months from the same year or they are just months from all the years?&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 24 Feb 2020 16:47:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945563#M10319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T16:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945573#M10320</link>
      <description>Please remember this well: Each and every model needs to have a proper Date table. A proper date table in DAX is a must. Please google for 'date table in power bi' or 'date table in dax.' Try to read an article about how to handle dates in DAX on &lt;A href="http://www.sqlbi.com" target="_blank"&gt;www.sqlbi.com&lt;/A&gt; or powerpivotpro.com. Your model does not have a proper date table, hence your problems.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 24 Feb 2020 16:51:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945573#M10320</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T16:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945591#M10323</link>
      <description>&lt;P&gt;Power Bi appears to have automatically recognised my "Inv Dates" as dates - screenshot below&lt;/P&gt;&lt;P&gt;However if i use the "Inv Date" as the X-axis with your DAX as my measure it still produces the graph as per my previous post and doesnt accumulate the values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 16:59:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945591#M10323</guid>
      <dc:creator>JamesGordon</dc:creator>
      <dc:date>2020-02-24T16:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945596#M10324</link>
      <description>You should never, ever, ever rely on automatic dates in Power BI. Simple as that. If you want to know why, you can do to &lt;A href="http://www.sqlbi.com" target="_blank"&gt;www.sqlbi.com&lt;/A&gt; and find the articles by The Italians that will explain to you in detail why this reliance is a bad idea.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 24 Feb 2020 17:01:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945596#M10324</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T17:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945599#M10325</link>
      <description>By the way... Can you please put the file on a shared drive (or part of it) so that I can take a look at why exactly the formula does not work? If I can't investigate this, then you have to just follow my advice. But you'd better create a proper Date table anyway. Otherwise, you'll be suffering. I've warned you.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 24 Feb 2020 17:03:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945599#M10325</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T17:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945608#M10327</link>
      <description>I think I know why it does not work... This is again the automatic dates feature rearing its ugly head. Please replace [Inv Date] with [Inv Date].[Date]. But be warned - this will bite you many a time if you don't do what I've said in my previous posts.&lt;BR /&gt;&lt;BR /&gt;best&lt;BR /&gt;D</description>
      <pubDate>Mon, 24 Feb 2020 17:08:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945608#M10327</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T17:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Totals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945615#M10328</link>
      <description>&lt;P&gt;Please try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative test =
var __maxDate = MAX ( 'Sheet (2)'[Inv date].[Date] )
var __minCost = 100
var __status = "S"
return
CALCULATE (
    SUM ( 'Sheet (2)'[Total Sell] ),
    KEEPFILTERS('Sheet (2)'[Status] = __status),
    KEEPFILTERS('Sheet (2)'[Total Cost] &amp;gt; __minCost),
    'Sheet (2)'[Inv date].[Date] &amp;lt;= __maxDate
)&lt;/LI-CODE&gt;
&lt;P&gt;Warning: DO NOT EVER RELY ON THE AUTOMATIC DATES FEATURE IN POWER BI. Unless you want to suffer...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 17:10:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Totals/m-p/945615#M10328</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T17:10:20Z</dc:date>
    </item>
  </channel>
</rss>

