<?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: Rolling sum of date ranges (recurring costs with start &amp;amp; end date) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3920735#M152602</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="738384" data-lia-user-login="xifeng_L" class="lia-mention lia-mention-user"&gt;xifeng_L&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Firstly, thank you for your effort and submitted proposal! Appreciate it very much!&lt;BR /&gt;&lt;BR /&gt;I'm almost there. What you coded is a great calculation that gives me daily consumption. I think it doesn't calculate a rolling sum. I managed to get it with additional DAX formula, but the last hurdle i have is, i would like the chart to stop at today (i have created a new table with calendar up-to-today). As of now, the chart goes on even if no data is inside. I would like to use my dynamic calendar table that goes up to today, or that the rolling sum function (line chart) stops with the last available data, even better...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://amperoxler-my.sharepoint.com/:u:/g/personal/matevz_petric_amperox_com/EXtyTP5xxmNGiMfOQ7EkH6EBfr3UB-wvXVFJ10TU-Zc7CA?e=e6KIWm" target="_blank" rel="noopener"&gt;Demo - Rolling sum of date ranges.pbix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Could you help me out with that as well? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2024 12:52:18 GMT</pubDate>
    <dc:creator>MatevzP</dc:creator>
    <dc:date>2024-05-15T12:52:18Z</dc:date>
    <item>
      <title>Rolling sum of date ranges (recurring costs with start &amp; end date)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3919824#M152572</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I did a simple rolling sum for invoices, but that was easy because i have a single date for each invoice.&amp;nbsp;&lt;BR /&gt;It looks something like this&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-align-left lia-indent-padding-left-30px"&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;SUM Rolling Costs to date =&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-align-left lia-indent-padding-left-30px"&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;CALCULATE( [SUM Cost Invoice],&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-align-left lia-indent-padding-left-30px"&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;FILTER(ALLSELECTED(mp_projectcost),&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-align-left lia-indent-padding-left-30px"&gt;&lt;FONT color="#808080"&gt;&lt;EM&gt;mp_projectcost[Date Issued] &amp;lt;= MAX(mp_projectcost[Date Issued])))&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-align-left lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-align-left"&gt;But now i'm facing a challange where i have to calculate a rolling (cumulative) sum for date ranges.&lt;BR /&gt;We have projects that run in parallel. With the Start and End date i get number of working days and dividing project budget by working days i get an average daily cost of a project.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV class="lia-align-left"&gt;Example from gantchart&lt;/DIV&gt;&lt;DIV class="lia-align-left"&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would i use start &amp;amp; end date of projects with daily average cost of each and calculate a rolling sum?&lt;BR /&gt;&lt;BR /&gt;As of now, this is all i have:&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This issue is well beyond me.&lt;BR /&gt;Help, please&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":weary_face:"&gt;😩&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 May 2024 08:05:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3919824#M152572</guid>
      <dc:creator>MatevzP</dc:creator>
      <dc:date>2024-05-15T08:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling sum of date ranges (recurring costs with start &amp; end date)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3919848#M152575</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="375594" data-lia-user-login="MatevzP" class="lia-mention lia-mention-user"&gt;MatevzP&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is your expected result? And can provide some sample data or pbix file?&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 08:13:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3919848#M152575</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-05-15T08:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling sum of date ranges (recurring costs with start &amp; end date)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3919861#M152576</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I would like to create an S-curve (primitive one). So everyday, i'd like to sum up everage daily costs of all projects ("PO Budget per day" calculation from the screen shot).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have sample data as it's confidential, but if needed, i could create something.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 08:16:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3919861#M152576</guid>
      <dc:creator>MatevzP</dc:creator>
      <dc:date>2024-05-15T08:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling sum of date ranges (recurring costs with start &amp; end date)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3920029#M152581</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="375594" data-lia-user-login="MatevzP" class="lia-mention lia-mention-user"&gt;MatevzP&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I modelled some of the data myself, not sure if I can reproduce your scenario but you can refer to it.&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;&lt;A href="https://1drv.ms/u/s!Avkq2QNvDlkrwTXzZaZ7s2qmta5q" target="_self"&gt;Demo - Rolling sum of date ranges.pbix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you~&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 09:06:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3920029#M152581</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-05-15T09:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling sum of date ranges (recurring costs with start &amp; end date)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3920735#M152602</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="738384" data-lia-user-login="xifeng_L" class="lia-mention lia-mention-user"&gt;xifeng_L&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Firstly, thank you for your effort and submitted proposal! Appreciate it very much!&lt;BR /&gt;&lt;BR /&gt;I'm almost there. What you coded is a great calculation that gives me daily consumption. I think it doesn't calculate a rolling sum. I managed to get it with additional DAX formula, but the last hurdle i have is, i would like the chart to stop at today (i have created a new table with calendar up-to-today). As of now, the chart goes on even if no data is inside. I would like to use my dynamic calendar table that goes up to today, or that the rolling sum function (line chart) stops with the last available data, even better...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://amperoxler-my.sharepoint.com/:u:/g/personal/matevz_petric_amperox_com/EXtyTP5xxmNGiMfOQ7EkH6EBfr3UB-wvXVFJ10TU-Zc7CA?e=e6KIWm" target="_blank" rel="noopener"&gt;Demo - Rolling sum of date ranges.pbix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Could you help me out with that as well? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 12:52:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3920735#M152602</guid>
      <dc:creator>MatevzP</dc:creator>
      <dc:date>2024-05-15T12:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling sum of date ranges (recurring costs with start &amp; end date)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3920803#M152603</link>
      <description>&lt;P&gt;In the meantime, i'll use a rimitive solution and put a date filter on the report, so we'll adjust manually the range.&lt;BR /&gt;It would be nice to have DAX do it for us automatically, but that will work as well.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 13:00:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3920803#M152603</guid>
      <dc:creator>MatevzP</dc:creator>
      <dc:date>2024-05-15T13:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling sum of date ranges (recurring costs with start &amp; end date)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3921038#M152608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="#community--1-" target="_blank" rel="noopener"&gt;@MatevzP&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, I misunderstood your needs and it turns out that there is also a need for cumulative.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try below cumulative measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Option 1&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;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Rolling cost 1 = 
IF([daily average cost]&amp;lt;&amp;gt;BLANK(),
    CALCULATE(
        [daily average cost],
        FILTER(
            ALLSELECTED('Calendar'),
            'Calendar'[Date] &amp;lt;= MAX('Calendar'[Date])
        )
    )
)

// Option 1 , This method may has flaws, such as if the value of a date in the middle is empty, that date will be ignored&lt;/LI-CODE&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;# Option 2&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;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Rolling cost 2 = 
VAR TempTable = 
    CALCULATETABLE(
        ADDCOLUMNS(VALUES('Calendar'[Date]),"Daily Cost",[daily average cost]),
        ALLSELECTED()
    )
VAR LatestDate = MAXX(FILTER(TempTable,[Daily Cost]&amp;lt;&amp;gt;BLANK()),'Calendar'[Date])
VAR CurDate = MAX('Calendar'[Date])
RETURN
IF(CurDate&amp;lt;=LatestDate,
    SUMX(
        FILTER(TempTable,'Calendar'[Date]&amp;lt;=CurDate),
        [Daily Cost]
    )
)&lt;/LI-CODE&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;&lt;!--  StartFragment   --&gt;&lt;A href="https://1drv.ms/u/s!Avkq2QNvDlkrwTXzZaZ7s2qmta5q" target="_blank" rel="noopener"&gt;Demo - Rolling sum of date ranges.pbix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you~&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;</description>
      <pubDate>Wed, 15 May 2024 14:21:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3921038#M152608</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-05-15T14:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling sum of date ranges (recurring costs with start &amp; end date)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3921135#M152612</link>
      <description>&lt;P&gt;OK,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="738384" data-lia-user-login="xifeng_L" class="lia-mention lia-mention-user"&gt;xifeng_L&lt;/a&gt;&amp;nbsp;, we are almost there, 90% what was desired.&lt;BR /&gt;I am sorry for nagging you so much.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;But we have a discrepancy with the calculation. We have omitted weekends when calculating "Average daily cost", but we display weekends in linechart and they are being accounted for in Rolling cost dax, hence the rolling (cumulative) cost is not matching the actuall SUM of all costs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I altered by using DATEDIFF function, that way we count also weekends for calculation, but a preferable way would be to also omitt weekends from the rolling calculation.&lt;/P&gt;&lt;P&gt;What i have so far is a column that denotes if it's a weekend or not. But i don't know how to incorporate to your "rolling cost2" dax code&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grimacing_face:"&gt;😬&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Is that someth that is easily acchieved? If it's not an easy one, counted weekends will also work.&lt;BR /&gt;Thank you so far!&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 15:08:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3921135#M152612</guid>
      <dc:creator>MatevzP</dc:creator>
      <dc:date>2024-05-15T15:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling sum of date ranges (recurring costs with start &amp; end date)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3921194#M152614</link>
      <description>&lt;P&gt;Nevermid. No dax wizardry needed! I simply filter the page with "isWeekday"...!&lt;BR /&gt;&lt;BR /&gt;Thank you so much for your help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 15:19:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3921194#M152614</guid>
      <dc:creator>MatevzP</dc:creator>
      <dc:date>2024-05-15T15:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling sum of date ranges (recurring costs with start &amp; end date)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3921205#M152615</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Good idea &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 15:24:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-sum-of-date-ranges-recurring-costs-with-start-amp-end/m-p/3921205#M152615</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-05-15T15:24:49Z</dc:date>
    </item>
  </channel>
</rss>

