<?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: Running Total with If in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389912#M25458</link>
    <description>&lt;LI-CODE lang="csharp"&gt;// This will work OK only IFF for each
// company there exists AT MOST 1 day
// in the Payments table.

[Cumul Payment] =
var __lastVisiblDate =
    MAX( Date[Date] )
var __onlyOneCompanyVisible =
    // Company should be a dimension
    // that joins to Payments, so please
    // do yourself a favour and make your
    // model into a proper star schema.
    // This code assumes that Company
    // exists only in your fact table
    // Payments but this is NOT how it
    // should be. If you have Company
    // as a dimension, you'll change the
    // code below to
    // HASONEVALUE( Company[CompanyID] )
    // instead.
    HASONEVALUE( Payments[Company] )
var __result =
    if( __onlyOneCompanyVisible,
        var __weOwnTheInvestment =
            CALCULATE(
                SELECTEDVALUE( Payments[Own?], 0 ) = 1,
                // This is where you have to make
                // sure that the assumption from
                // above is observed. Otherwise,
                // the value of CALCULATE will always
                // return False.
                Date[Date] = __lastVisibleDate
            )
        RETURN
        if( __weOwnTheInvestment,
            CALCULATE(
                SUM( Payments[Payment] ),
                // Date must be a date table
                // in the model marked as such
                // for this to work OK.
                Date[Date] &amp;lt;= __lastVisibleDate
                
                // If you want to only sum up
                // the payments where [Own?] is 1
                // then you have to add as a filter
                // this condition to this CALCULATE:
                // Payments[Own?] = 1.
                // But if you do this, you'll only
                // get a running total for the
                // payments that you own, not the
                // true running total. But maybe this is
                // what you want... Nevertheless, the code
                // only displays the total if the
                // max day for the visible company
                // has the flag set to 1 regardless
                // of the method of summation.
            )
        )
    )
return
    __result&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 23 Sep 2020 10:15:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-23T10:15:56Z</dc:date>
    <item>
      <title>Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389103#M25421</link>
      <description>&lt;P&gt;Hi. I have a measure of running total of payments made for investments over time. I also have an input table that shows when my department owns the investments and when we don't (an "ownership Boolean" table, if you like). How do I modify the running total measure so that it only shows the running total when we own it?&lt;BR /&gt;&lt;BR /&gt;The running total measure is (I've copied this from a forum and have adjusted it for my own use):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cash Cost&amp;nbsp; = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR LastVisibleDate =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX ( 'Date'[Date] ) &lt;FONT color="#008000"&gt;-- my date table and date column&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR FirstVisibleDate =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN ( 'Payments'[Date] ) &lt;FONT color="#008000"&gt;-- dates of the payments made for the investments&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR LastDateWithCashflow =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX ( 'Payments'[Date] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;REMOVEFILTERS ()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;VAR Result =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FirstVisibleDate &amp;lt;= LastDateWithCashflow,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUM('Payments'[Payments]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Date'[Date] &amp;lt;= LastVisibleDate&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Result&lt;BR /&gt;&lt;BR /&gt;The Payments table looks something like this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Payments&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Investment in Company&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15-Apr-05&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30-Jun-08&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31-Dec-09&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31-Dec-09&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;80&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;B&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;The&amp;nbsp;"ownership Boolean" table (a "1" means that we own it at that point in time and a "0" means that we don't):&lt;BR /&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;So yes, how do I modify the running total measure ("Cash Cost") to only show a number when "Own?" equals 1? Thank you&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Sep 2020 04:20:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389103#M25421</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-23T04:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389131#M25423</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Maybe:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cash Cost  =
VAR LastVisibleDate =
MAX ( 'Date'[Date] ) -- my date table and date column
VAR FirstVisibleDate =
MIN ( 'Payments'[Date] ) -- dates of the payments made for the investments 
VAR LastDateWithCashflow =
 
MAX ( 'Payments'[Date] ),
REMOVEFILTERS ()

VAR Result =
IF (
FirstVisibleDate &amp;lt;= LastDateWithCashflow,
CALCULATE (
SUM('Payments'[Payments]),
'Date'[Date] &amp;lt;= LastVisibleDate,
'Ownership'[Own?]=1
)
)
 
RETURN
Result&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Sep 2020 04:49:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389131#M25423</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-23T04:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389297#M25427</link>
      <description>&lt;P&gt;Hi &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;. Thanks but I've actually tried that. Oh, by the way, sorry, I forgot to type CALCULATE for the MAX and REMOVEFILTERS bit. Anyway therefore I guess the source of my error is the relationships in my data model then:&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;Initially I was hoping to (naively)&amp;nbsp; link 'Date'[Date] with 'Ownership'[Date] as well only to discover that that's not allowed because there would be an indirect relationship or introduce ambiguity.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 06:42:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389297#M25427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-23T06:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389443#M25433</link>
      <description>Please show us a relevant example of what you really want. Thanks.</description>
      <pubDate>Wed, 23 Sep 2020 07:28:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389443#M25433</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-23T07:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389730#M25447</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;(cool nickname btw, very apt). Sure, I'd be happy to. You've probably noticed that I stopped owning the investment A starting 31 Jan 2010 and stopped owning B starting 14 Feb 2010. Therefore in a Matrix, I would like to have a (conditional) running total like this:&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;However despite using&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE (&lt;/P&gt;&lt;P&gt;SUM('Payments'[Payments]),&lt;/P&gt;&lt;P&gt;'Date'[Date] &amp;lt;= LastVisibleDate,&lt;/P&gt;&lt;P&gt;'Ownership'[Own?]=1)&lt;/P&gt;&lt;P&gt;)&lt;BR /&gt;&lt;BR /&gt;, the condition " 'Ownership'[Own?]=1 " doesn't have an effect and I get a Matrix like this instead:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 09:06:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389730#M25447</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-23T09:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389912#M25458</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// This will work OK only IFF for each
// company there exists AT MOST 1 day
// in the Payments table.

[Cumul Payment] =
var __lastVisiblDate =
    MAX( Date[Date] )
var __onlyOneCompanyVisible =
    // Company should be a dimension
    // that joins to Payments, so please
    // do yourself a favour and make your
    // model into a proper star schema.
    // This code assumes that Company
    // exists only in your fact table
    // Payments but this is NOT how it
    // should be. If you have Company
    // as a dimension, you'll change the
    // code below to
    // HASONEVALUE( Company[CompanyID] )
    // instead.
    HASONEVALUE( Payments[Company] )
var __result =
    if( __onlyOneCompanyVisible,
        var __weOwnTheInvestment =
            CALCULATE(
                SELECTEDVALUE( Payments[Own?], 0 ) = 1,
                // This is where you have to make
                // sure that the assumption from
                // above is observed. Otherwise,
                // the value of CALCULATE will always
                // return False.
                Date[Date] = __lastVisibleDate
            )
        RETURN
        if( __weOwnTheInvestment,
            CALCULATE(
                SUM( Payments[Payment] ),
                // Date must be a date table
                // in the model marked as such
                // for this to work OK.
                Date[Date] &amp;lt;= __lastVisibleDate
                
                // If you want to only sum up
                // the payments where [Own?] is 1
                // then you have to add as a filter
                // this condition to this CALCULATE:
                // Payments[Own?] = 1.
                // But if you do this, you'll only
                // get a running total for the
                // payments that you own, not the
                // true running total. But maybe this is
                // what you want... Nevertheless, the code
                // only displays the total if the
                // max day for the visible company
                // has the flag set to 1 regardless
                // of the method of summation.
            )
        )
    )
return
    __result&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Sep 2020 10:15:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1389912#M25458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-23T10:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1396119#M25633</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;, almost! It's just that the totals are blank.&lt;BR /&gt;&lt;BR /&gt;Thank you for your advice. I have&amp;nbsp;improved my model into a proper star schema. So I've done 3 things:&lt;BR /&gt;&lt;BR /&gt;1) I've added a Dimension table of company names&lt;BR /&gt;&lt;BR /&gt;2) Now I'm treating the Ownership table as a fact table. Previously I had naively treated it as a Dimension table but upon reading more Power BI articles, I've realised that it is actually a "slowly changing dimension" and that a Dimension table must have a Dimension Key which my Ownership table of time-varying ownership of companies doesn't have.&lt;BR /&gt;&lt;BR /&gt;3) Therefore I've edited your measure from using&amp;nbsp;HASONEVALUE( Payments[Company] ) to something like HASONEVALUE( Company[Company ID] )&lt;BR /&gt;&lt;BR /&gt;I've turned my dashboard report into a stripped-down dummy one&amp;nbsp; with fake names and figures here&amp;nbsp;&lt;A href="https://www.dropbox.com/s/njy7m84htsul4r7/Dannial%20for%20Forum.pbix?dl=0" target="_blank"&gt;https://www.dropbox.com/s/njy7m84htsul4r7/Dannial%20for%20Forum.pbix?dl=0&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;A good sample is company Z-Corp which was no longer owned starting 31-Mar-2018. So correct, it's running total (cumulative payments) is blank on that date onwards (note: all my dates are end of quarter). But it's just that there are no totals nor subtotals (by company nor by year):&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;So how can one make the totals appear?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 15:12:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1396119#M25633</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-25T15:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1399512#M25735</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&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;&lt;BR /&gt;&lt;BR /&gt;After reading a few articles, I think I know why the totals are blank - because their Own &amp;gt; 1.&lt;BR /&gt;&lt;BR /&gt;So I've tried changing the codes from:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;__weOwnTheInvestment =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECTEDVALUE( 'Ownership'[Own?], 0 ) &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;= 1&lt;/STRONG&gt;&lt;/FONT&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Date'[Date] = __lastVisibleDate&lt;BR /&gt;&lt;BR /&gt;to:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;__weOwnTheInvestment =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECTEDVALUE( 'Ownership'[Own?], 0 ) &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;&amp;gt; 0&lt;/FONT&gt;&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Date'[Date] = __lastVisibleDate&lt;BR /&gt;&lt;BR /&gt;But the totals (at each date) are still blanks.&lt;BR /&gt;The articles I've read also had mentioned that typically for the totals to equal the visual totals, one should use the function SUMX.&lt;BR /&gt;&lt;BR /&gt;However, I think that SUMX's arguments must be from the same table whereas mine is more like:&lt;BR /&gt;&lt;BR /&gt;Cumul Payment if Owned = SUMX( ? , [Cumul Payment]* 'Ownership'[Own?])&lt;BR /&gt;&lt;BR /&gt;Basically a SUMPRODUCT&lt;BR /&gt;&lt;BR /&gt;So how can one get the totals to be equal to the visual total? Would I need to, and would it even be possible, to create a calculated table that contains: 'Date'[Date]; 'Company'[Company]; Cumul Payment; and 'Ownership'[Own?] so that I can do a SUMX?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:44:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1399512#M25735</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-28T13:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1399863#M25743</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;-&amp;nbsp;This looks like a measure totals problem. Very common. See my post about it here: &lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376" target="_blank"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:12:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1399863#M25743</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-28T16:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1399921#M25744</link>
      <description>Question 1: Why would you store the bool flag [Own?] as something else than a True/False flag?&lt;BR /&gt;&lt;BR /&gt;Question 2: From what you've said above I understand that when you are saying "cumulative" it means you only want to aggregate from beginning to the current date but only over those dates for which the flag is True? Am I correct?&lt;BR /&gt;&lt;BR /&gt;Question 3: I don't quite get how the total row should work. If the company in question (say, there's only one visible) has the last day visible in the context (which means on the total row) with the flag set to False, you can't display the total because you'd violate the rules of the measure. If you do want to display any kind of total, then you have to modify the rules of your measure. It is to say that the rules of calculation must be consistent and with the current setup and your 'desire' they are not.</description>
      <pubDate>Mon, 28 Sep 2020 16:41:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1399921#M25744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-28T16:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1400532#M25772</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;Question 1: Why would you store the bool flag [Own?] as something else than a True/False flag?&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;Answer: If I store [Own?] as 1s and 0s, I can multiply [Own?] with the unconditional running total (which I can already do). Then perhaps I can sum them for a particular date. For example, for one date which is 30th June 2020:&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;Question 2: From what you've said above I understand that when you are saying "cumulative" it means you only want to aggregate from beginning to the current date but only over those dates for which the flag is True? Am I correct?&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;Answer: Yes, correct.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;Question 3: I don't quite get how the total row should work. If the company in question (say, there's only one visible) has the last day visible in the context (which means on the total row) with the flag set to False, you can't display the total because you'd violate the rules of the measure. If you do want to display any kind of total, then you have to modify the rules of your measure. It is to say that the rules of calculation must be consistent and with the current setup and your 'desire' they are not.&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;My reply: OK, I see. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 00:39:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1400532#M25772</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-29T00:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total with If</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1401380#M25790</link>
      <description>As for the True/False flag: YES, YOU CAN MULTIPLY BOOLS WITH NUMBERS and they'll be treated then as 1 and 0, respectively. In DAX, there's no way to tell (in a visual) whether you're on the total row or not. If, say, you choose months instead of days to be displayed on rows and the total will therefore have all the months in a year, you will display the cumulatives for only those months where the last day has the [Own?] flag set to True. Otherwise, you'd display BLANK. Same goes for the total - whether you display a figure or not depends on what there is in the last day. This would be very messy. On the other hand, if you say "If there is more than 1 day visible in the context, display the cumulative until the last day in the period that has the flag set to True", you will almost get what you want apart from the fact that there may be a BLANK total whereas most of the months will have a figure.... The way you want to calculate your measure, or rather display it, is hard to make consistent. I'd think about a different way: calculate the cumulative for ANY day but use the flag to only include the "True" days. This way, you'd easily implement a total that would be consistent with your detail rows.</description>
      <pubDate>Tue, 29 Sep 2020 09:01:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-with-If/m-p/1401380#M25790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-29T09:01:25Z</dc:date>
    </item>
  </channel>
</rss>

