<?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 for previous month stops at the last day of current month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-for-previous-month-stops-at-the-last-day-of/m-p/4403676#M174805</link>
    <description>&lt;P&gt;Petition for all months to have the same number of days! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is what it is.&amp;nbsp; The time intelligence functions have to perform contorsions when it comes to "same day last month"&amp;nbsp; at the end of each month.&amp;nbsp; There is no real "fix"&amp;nbsp; for that.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Feb 2025 20:42:38 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2025-02-10T20:42:38Z</dc:date>
    <item>
      <title>Running total for previous month stops at the last day of current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-for-previous-month-stops-at-the-last-day-of/m-p/4403259#M174788</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following measure to calculate the running total for the previous month:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE (
        [_UmsatzTotal],
        DATESMTD (
            DATEADD ( Datumstabelle[FullDateAlternateKey], -1, MONTH )
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked fine in January, but in February, the running total only goes up to the 28th.&lt;/P&gt;&lt;P&gt;I found another way to do it, but I still have the same issue:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE(
    [_UmsatzTotal],
    FILTER(
        ALL( Datumstabelle ),
        Datumstabelle[Monat Relativ] = MAX( Datumstabelle[Monat Relativ] ) + 1
        &amp;amp;&amp;amp; Datumstabelle[Day] &amp;lt;= MAX ( Datumstabelle[Day] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It always takes the Day value in my date table for the current month which only goes up to 28 in February.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have an idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 15:46:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-for-previous-month-stops-at-the-last-day-of/m-p/4403259#M174788</guid>
      <dc:creator>jori</dc:creator>
      <dc:date>2025-02-10T15:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Running total for previous month stops at the last day of current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-for-previous-month-stops-at-the-last-day-of/m-p/4403676#M174805</link>
      <description>&lt;P&gt;Petition for all months to have the same number of days! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is what it is.&amp;nbsp; The time intelligence functions have to perform contorsions when it comes to "same day last month"&amp;nbsp; at the end of each month.&amp;nbsp; There is no real "fix"&amp;nbsp; for that.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 20:42:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-for-previous-month-stops-at-the-last-day-of/m-p/4403676#M174805</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-02-10T20:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Running total for previous month stops at the last day of current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-for-previous-month-stops-at-the-last-day-of/m-p/4404243#M174838</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="465876" data-lia-user-login="jori" class="lia-mention lia-mention-user"&gt;jori&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can use the EOMONTH function to get the last day of the previous month and then calculate the summary from the first to the last day of the previous month.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE(
    [_UmsatzTotal],
    DATESBETWEEN(
        Datumstabelle[FullDateAlternateKey],
        EOMONTH(TODAY(), -2) + 1,
        EOMONTH(TODAY(), -1)
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;You could adjust the date filter to ensure that no dates are missed when working with February.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE(
    [_UmsatzTotal],
    FILTER(
        ALL(Datumstabelle),
        Datumstabelle[Monat Relativ] = MAX(Datumstabelle[Monat Relativ]) - 1
        &amp;amp;&amp;amp; Datumstabelle[Day] &amp;lt;= MAX(Datumstabelle[Day])
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;If the above codes still not help you get the expected result,&amp;nbsp;please provide some&amp;nbsp;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&amp;nbsp;in your tables&amp;nbsp;(&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/EM&gt;&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks for your understanding. Your time and cooperation are much valued by us. We are looking forward to hearing from you to assist further.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Lucy Chen&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it&lt;/EM&gt;&lt;/STRONG&gt; as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 05:37:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-for-previous-month-stops-at-the-last-day-of/m-p/4404243#M174838</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-11T05:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Running total for previous month stops at the last day of current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-for-previous-month-stops-at-the-last-day-of/m-p/4404747#M174856</link>
      <description>&lt;P&gt;Unfortunately, this does not calculate the &lt;STRONG&gt;running&lt;/STRONG&gt; total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually found a way though:&lt;/P&gt;&lt;P&gt;Instead of having the current month in the x-axis, I keep the date fixed on January of this year.&lt;/P&gt;&lt;P&gt;Then I just change the relative month in the measure based on the difference to January (it's negative for me because the relative date for the past is a positive value in my model):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR Relativ = MONTH ( TODAY () ) - 2

RETURN
CALCULATE(
    [_UmsatzTotal],
    FILTER(
        ALL( Datumstabelle ),
        Datumstabelle[Monat Relativ] = MAX( Datumstabelle[Monat Relativ] ) - Relativ
        &amp;amp;&amp;amp; Datumstabelle[Day] &amp;lt;= MAX ( Datumstabelle[Day] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 09:44:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-for-previous-month-stops-at-the-last-day-of/m-p/4404747#M174856</guid>
      <dc:creator>jori</dc:creator>
      <dc:date>2025-02-11T09:44:47Z</dc:date>
    </item>
  </channel>
</rss>

