<?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: Calculating Running Total based on slicer date range in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Running-Total-based-on-slicer-date-range/m-p/3212639#M117210</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your calendar table is structured, but please try something like below whether it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Spent Running Total =
VAR _year =
    MAX ( CalendarDates[FiscalYear] )
VAR _fyadjust =
    MAX ( CalendarDates[FiscalYearAdjusted] )
VAR MinDate =
    CALCULATE ( MIN ( CalendearDates[Dates] ), ALLSELECTED ( CalendarDates ) )
VAR MaxDate =
    CALCULATE (
        MAX ( CalendarDates[Dates] ),
        FILTER (
            ALLSELECTED ( CalendarDates ),
            CalendarDates[Year] = _year
                &amp;amp;&amp;amp; CalendarDates[FiscalYearAdjusted] = _fyadjust
        )
    )
VAR DatesToUse =
    FILTER (
        ALL ( CalendarDates ),
        CalendarDates[Dates] &amp;gt;= MinDate
            &amp;amp;&amp;amp; CalendarDates[Dates] &amp;lt;= MaxDate
    )
VAR Result =
    CALCULATE ( [Total Spent], DatesToUse )
RETURN
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 30 Apr 2023 05:34:18 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2023-04-30T05:34:18Z</dc:date>
    <item>
      <title>Calculating Running Total based on slicer date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Running-Total-based-on-slicer-date-range/m-p/3212533#M117204</link>
      <description>&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;I'm trying to calculate a running total based on the slicer selection for the date range. For some reason every time I put in the start date, the running total stops working. I think I'm really close with the DAX code below but I can't figure out what I'm doing wrong. Any help would be greatly appreciated! Thanks in advance.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Spent Running Total =&amp;nbsp;&lt;BR /&gt;VAR MinDate = CALCULATE(MIN(CalendearDates[Dates]),ALLSELECTED(CalendarDates[Dates]))&lt;BR /&gt;VAR MaxDate = CALCULATE(MAX(CalendarDates[Dates]),ALLSELECTED(CalendarDates[Dates]))&lt;BR /&gt;VAR DatesToUse =&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DATESBETWEEN(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CalendarDates[Dates],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MinDate,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MaxDate)&lt;BR /&gt;VAR Result = CALCULATE([Total Spent],DatesToUse)&lt;BR /&gt;RETURN Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2023 00:14:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Running-Total-based-on-slicer-date-range/m-p/3212533#M117204</guid>
      <dc:creator>Shanks_403</dc:creator>
      <dc:date>2023-04-30T00:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Running Total based on slicer date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Running-Total-based-on-slicer-date-range/m-p/3212639#M117210</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your calendar table is structured, but please try something like below whether it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Spent Running Total =
VAR _year =
    MAX ( CalendarDates[FiscalYear] )
VAR _fyadjust =
    MAX ( CalendarDates[FiscalYearAdjusted] )
VAR MinDate =
    CALCULATE ( MIN ( CalendearDates[Dates] ), ALLSELECTED ( CalendarDates ) )
VAR MaxDate =
    CALCULATE (
        MAX ( CalendarDates[Dates] ),
        FILTER (
            ALLSELECTED ( CalendarDates ),
            CalendarDates[Year] = _year
                &amp;amp;&amp;amp; CalendarDates[FiscalYearAdjusted] = _fyadjust
        )
    )
VAR DatesToUse =
    FILTER (
        ALL ( CalendarDates ),
        CalendarDates[Dates] &amp;gt;= MinDate
            &amp;amp;&amp;amp; CalendarDates[Dates] &amp;lt;= MaxDate
    )
VAR Result =
    CALCULATE ( [Total Spent], DatesToUse )
RETURN
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2023 05:34:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Running-Total-based-on-slicer-date-range/m-p/3212639#M117210</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-04-30T05:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Running Total based on slicer date range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Running-Total-based-on-slicer-date-range/m-p/3214003#M117296</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response. My calendar is automated in Power Query and it just adds a day every day on the CalendarDates[Dates] column in the format "yyyy-MM-dd". I revised the formula below but still no luck. Any thoughts?&lt;/P&gt;&lt;DIV&gt;Total Actuals to Date =&lt;DIV&gt;&lt;SPAN&gt;VAR MinDate =&amp;nbsp;CALCULATE(MIN(CalendarDates[Dates]),ALLSELECTED(CalendarDates[Dates]))&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR MaxDate =&amp;nbsp;CALCULATE(MAX(CalendarDates[Dates]),ALLSELECTED(CalendarDates[Dates]))&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR DatesToUse =&amp;nbsp;FILTER (&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ALL(CalendarDates),&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CalendarDates[Dates] &amp;gt;= MinDate&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; CalendarDates[Dates] &amp;lt;= MaxDate&lt;DIV&gt;)&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [Sum of PaidTotal_Accruals],&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatesToUse&lt;DIV&gt;&amp;nbsp; &amp;nbsp; )&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 01 May 2023 15:48:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Running-Total-based-on-slicer-date-range/m-p/3214003#M117296</guid>
      <dc:creator>Shanks_403</dc:creator>
      <dc:date>2023-05-01T15:48:54Z</dc:date>
    </item>
  </channel>
</rss>

