<?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 Minimum value of Running Total in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2486357#M68289</link>
    <description>&lt;P&gt;Hi all -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched all over and can't find a solution.&amp;nbsp; I'm attaching sample data and a sample PBIX file.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with dates, times, accounts and amounts.&amp;nbsp; Each account could have multiple transactions during the day.&amp;nbsp; The times are essentially categorical in that they represent a period of time (all transactions between say 7:00 and 8:00).&amp;nbsp; The goal is to compute a running total each day and then find the minimum of that total for each day and be able to graph that value.&amp;nbsp; I can get it working when a single account or no account is selected in the slicer, but if more than one account is chosen, I do not get the correct minimum value.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My measures:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Amount = SUM(Table1[Amount])

Running Account Balance (all accounts) = 
    CALCULATE([Total Amount], 
        FILTER(
            ALLEXCEPT('Table1','Table1'[Date]),
            'Table1'[Time] &amp;lt;= MAX('Table1'[Time])
        )
    )

Running Account Balance = 
    CALCULATE([Total Amount], 
        FILTER(
            ALLEXCEPT(Table1,'Table1'[Account],'Table1'[Date]),
            'Table1'[Time] &amp;lt;= MAX('Table1'[Time])
        )
    )

Min Running Bal = 
    var MinRunningBalNoAccount = minx('Table1',[Running Account Balance (all accounts)])
    var MinRunningBalAccount = minx('Table1',[Running Account Balance])

Return
    IF(ISFILTERED('Table1'[Account]),
        MinRunningBalAccount,
        MinRunningBalNoAccount)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I select a single account or not account, I get the correct Min Running Bal.&amp;nbsp; But if I select multiple accounts I don't.&amp;nbsp; What I really want is for DAX to sum the running total for all selected accounts and THEN figure out the minimum.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it is clear what I am talking about, but I'm happy to provide more details if needed.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope these links to the files work!&lt;BR /&gt;&lt;A href="https://iowa-my.sharepoint.com/:x:/g/personal/zoberender_uiowa_edu/EYeB7nmuAdxDtzZeObP5eLIB02c1aLUsuOcipz2YNW5BRg?e=IuJN4D" target="_blank" rel="noopener"&gt;Excel File&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;A href="https://iowa-my.sharepoint.com/:u:/g/personal/zoberender_uiowa_edu/EYvRyB4xVOJPu_CgIkycjqQBGL7rp9yOgMSgonN5QzCIPg?e=VGPjfi" target="_blank" rel="noopener"&gt;PBIX File&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Apr 2022 18:48:04 GMT</pubDate>
    <dc:creator>zoberender</dc:creator>
    <dc:date>2022-04-29T18:48:04Z</dc:date>
    <item>
      <title>Minimum value of Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2486357#M68289</link>
      <description>&lt;P&gt;Hi all -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched all over and can't find a solution.&amp;nbsp; I'm attaching sample data and a sample PBIX file.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with dates, times, accounts and amounts.&amp;nbsp; Each account could have multiple transactions during the day.&amp;nbsp; The times are essentially categorical in that they represent a period of time (all transactions between say 7:00 and 8:00).&amp;nbsp; The goal is to compute a running total each day and then find the minimum of that total for each day and be able to graph that value.&amp;nbsp; I can get it working when a single account or no account is selected in the slicer, but if more than one account is chosen, I do not get the correct minimum value.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My measures:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Amount = SUM(Table1[Amount])

Running Account Balance (all accounts) = 
    CALCULATE([Total Amount], 
        FILTER(
            ALLEXCEPT('Table1','Table1'[Date]),
            'Table1'[Time] &amp;lt;= MAX('Table1'[Time])
        )
    )

Running Account Balance = 
    CALCULATE([Total Amount], 
        FILTER(
            ALLEXCEPT(Table1,'Table1'[Account],'Table1'[Date]),
            'Table1'[Time] &amp;lt;= MAX('Table1'[Time])
        )
    )

Min Running Bal = 
    var MinRunningBalNoAccount = minx('Table1',[Running Account Balance (all accounts)])
    var MinRunningBalAccount = minx('Table1',[Running Account Balance])

Return
    IF(ISFILTERED('Table1'[Account]),
        MinRunningBalAccount,
        MinRunningBalNoAccount)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I select a single account or not account, I get the correct Min Running Bal.&amp;nbsp; But if I select multiple accounts I don't.&amp;nbsp; What I really want is for DAX to sum the running total for all selected accounts and THEN figure out the minimum.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it is clear what I am talking about, but I'm happy to provide more details if needed.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope these links to the files work!&lt;BR /&gt;&lt;A href="https://iowa-my.sharepoint.com/:x:/g/personal/zoberender_uiowa_edu/EYeB7nmuAdxDtzZeObP5eLIB02c1aLUsuOcipz2YNW5BRg?e=IuJN4D" target="_blank" rel="noopener"&gt;Excel File&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;A href="https://iowa-my.sharepoint.com/:u:/g/personal/zoberender_uiowa_edu/EYvRyB4xVOJPu_CgIkycjqQBGL7rp9yOgMSgonN5QzCIPg?e=VGPjfi" target="_blank" rel="noopener"&gt;PBIX File&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 18:48:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2486357#M68289</guid>
      <dc:creator>zoberender</dc:creator>
      <dc:date>2022-04-29T18:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum value of Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2486508#M68300</link>
      <description>&lt;P&gt;You need to take the minimum at the appropriate granularity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Min Running Balance = 
VAR _Summary_ =
    ADDCOLUMNS(
        SUMMARIZE ( Table1, Table1[Date], Table1[Time] ),
        "@RunBal", [Running Account Balance]
    )
RETURN
    MINX ( _Summary_, [@RunBal] )&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 29 Apr 2022 21:46:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2486508#M68300</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-04-29T21:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum value of Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2488652#M68421</link>
      <description>&lt;P&gt;Perfect!&amp;nbsp; Thanks so much.&amp;nbsp; I knew I was at the wrong granularity, just couldn't quite get it tow work.&amp;nbsp; Appreciate the help!&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2022 12:35:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2488652#M68421</guid>
      <dc:creator>zoberender</dc:creator>
      <dc:date>2022-05-02T12:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum value of Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2595993#M74929</link>
      <description>&lt;P&gt;This is perfect!! Thank you, I've been looking for this exact solution for a couple of weeks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, how would I pull the corresponding date of when the minimum running balance occurs?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 23:37:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2595993#M74929</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-22T23:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum value of Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2598044#M75025</link>
      <description>&lt;P&gt;You could filter the summary table for the minimum balance row(s) and take the date column from the filtered table.&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Min Running Balance Date =
VAR _Summary_ =
    ADDCOLUMNS (
        SUMMARIZE ( Table1, Table1[Date], Table1[Time] ),
        "@RunBal", [Running Account Balance]
    )
VAR _MinBal =
    MINX ( _Summary_, [@RunBal] )
RETURN
    MINX ( FILTER ( _Summary_, [@RunBal] = _MinBal ), Table1[Date] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 14:32:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2598044#M75025</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-06-23T14:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Minimum value of Running Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2598254#M75029</link>
      <description>&lt;P&gt;Absolutely genius...Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 15:38:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Minimum-value-of-Running-Total/m-p/2598254#M75029</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-23T15:38:40Z</dc:date>
    </item>
  </channel>
</rss>

