<?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: Creating a visual line graph with cumulative sales for same month 1 year ago - ENTIRE MONTH in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342800#M172436</link>
    <description>&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Thanks for the reply from pcoley&amp;nbsp; and Kedar_Pande&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="905149" data-lia-user-login="BBECQ" class="lia-mention lia-mention-user"&gt;BBECQ&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Thanks for reaching out to the Microsoft fabric community forum.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Regarding the issue you raised, my solution is as follows:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;1.&lt;/SPAN&gt;&lt;SPAN&gt;Firstly, I created the following test data:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;&lt;SPAN&gt;Secondly, I modified the measures as follows:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative Sales LY = 
VAR aa =
    CALCULATE (
        SUM ( 'CSV Import Daily'[Sales Result] ),
        SAMEPERIODLASTYEAR ( DATESMTD ( 'CSV Import Daily'[DATE] ) )
    )
RETURN
    IF (
        MAX ( 'CSV Import Daily'[Date] )
            = CALCULATE ( MAX ( 'CSV Import Daily'[Date] ), ALL ( 'CSV Import Daily' ) ),
        aa
            - CALCULATE (
                SUM ( 'CSV Import Daily'[Sales Result] ),
                FILTER (
                    ALL ( 'CSV Import Daily' ),
                    'CSV Import Daily'[Date] &amp;gt; EDATE ( TODAY (), -12 )
                        &amp;amp;&amp;amp; 'CSV Import Daily'[Date] &amp;lt;= EOMONTH ( TODAY (), -12 )
                )
            ),
        aa
    )
&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;3.Here's my final result, which I hope meets your requirements.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Please find the attached pbix relevant to the case.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider Accept it &lt;EM&gt;&lt;STRONG&gt;as the solution &lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Dec 2024 07:56:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-12-25T07:56:54Z</dc:date>
    <item>
      <title>Creating a visual line graph with cumulative sales for same month 1 year ago - ENTIRE MONTH</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4341904#M172419</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;This DAX formula already give me the cumulative sales for same month 1 year ago, for all dates until today 1 year ago.&lt;BR /&gt;However, since all sales are known for the entire month 1 year ago, I would like to see the full month cumulative sales.&lt;BR /&gt;I can't seem to find how to adapt this formula to keep providing data points until the last day of the month&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cumulative Sales LY =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_maxdate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'CSV Import Daily'&lt;/SPAN&gt;&lt;SPAN&gt;[DATE]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'CSV Import Daily'&lt;/SPAN&gt;&lt;SPAN&gt;[Sales Result]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'CSV Import Daily'&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'CSV Import Daily'&lt;/SPAN&gt;&lt;SPAN&gt;[DATE]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;_maxdate&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SAMEPERIODLASTYEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DATESMTD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'CSV Import Daily'&lt;/SPAN&gt;&lt;SPAN&gt;[DATE]&lt;/SPAN&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;</description>
      <pubDate>Tue, 24 Dec 2024 08:53:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4341904#M172419</guid>
      <dc:creator>BBECQ</dc:creator>
      <dc:date>2024-12-24T08:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a visual line graph with cumulative sales for same month 1 year ago - ENTIRE MONTH</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342038#M172421</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="905149" data-lia-user-login="BBECQ" class="lia-mention lia-mention-user"&gt;BBECQ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Cumulative Sales LY Full Month =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('CSV Import Daily'[Sales Result]),&lt;BR /&gt;SAMEPERIODLASTYEAR(DATESMTD('CSV Import Daily'[DATE]))&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":love_letter:"&gt;💌&lt;/span&gt; &lt;STRONG&gt;If this helped, a Kudos &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; or Solution mark &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; would be great! &lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;/STRONG&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Kedar&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/kedar-pande" target="_blank" rel="noopener"&gt;Connect on LinkedIn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2024 10:55:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342038#M172421</guid>
      <dc:creator>Kedar_Pande</dc:creator>
      <dc:date>2024-12-24T10:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a visual line graph with cumulative sales for same month 1 year ago - ENTIRE MONTH</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342153#M172426</link>
      <description>&lt;P&gt;Thanks!!&lt;BR /&gt;What I notice with your formula is that on today (Dec 24th) the cumulative total already in includes sales from 26-27 &amp;amp; 28/12/2023 ... Bizar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2024 13:20:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342153#M172426</guid>
      <dc:creator>BBECQ</dc:creator>
      <dc:date>2024-12-24T13:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a visual line graph with cumulative sales for same month 1 year ago - ENTIRE MONTH</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342250#M172430</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="905149" data-lia-user-login="BBECQ" class="lia-mention lia-mention-user"&gt;BBECQ&lt;/a&gt;&amp;nbsp;please try with PARALLELPERIOD instead of SAMEPERIODLASTYEAR in your formula.&lt;BR /&gt;&lt;BR /&gt;CALCULATE ( ...,&lt;BR /&gt;&lt;STRONG&gt;PARALLELPERIOD&lt;/STRONG&gt; ( &lt;SPAN&gt;DATESMTD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'CSV Import Daily'&lt;/SPAN&gt;&lt;SPAN&gt;[DATE]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;STRONG&gt;, -1, YEAR ) )&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;I hope this helps you, if so please accept the solution. Kudos are welcome&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2024 15:16:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342250#M172430</guid>
      <dc:creator>pcoley</dc:creator>
      <dc:date>2024-12-24T15:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a visual line graph with cumulative sales for same month 1 year ago - ENTIRE MONTH</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342800#M172436</link>
      <description>&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Thanks for the reply from pcoley&amp;nbsp; and Kedar_Pande&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="905149" data-lia-user-login="BBECQ" class="lia-mention lia-mention-user"&gt;BBECQ&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Thanks for reaching out to the Microsoft fabric community forum.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Regarding the issue you raised, my solution is as follows:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;1.&lt;/SPAN&gt;&lt;SPAN&gt;Firstly, I created the following test data:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial;"&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;&lt;SPAN&gt;Secondly, I modified the measures as follows:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative Sales LY = 
VAR aa =
    CALCULATE (
        SUM ( 'CSV Import Daily'[Sales Result] ),
        SAMEPERIODLASTYEAR ( DATESMTD ( 'CSV Import Daily'[DATE] ) )
    )
RETURN
    IF (
        MAX ( 'CSV Import Daily'[Date] )
            = CALCULATE ( MAX ( 'CSV Import Daily'[Date] ), ALL ( 'CSV Import Daily' ) ),
        aa
            - CALCULATE (
                SUM ( 'CSV Import Daily'[Sales Result] ),
                FILTER (
                    ALL ( 'CSV Import Daily' ),
                    'CSV Import Daily'[Date] &amp;gt; EDATE ( TODAY (), -12 )
                        &amp;amp;&amp;amp; 'CSV Import Daily'[Date] &amp;lt;= EOMONTH ( TODAY (), -12 )
                )
            ),
        aa
    )
&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;3.Here's my final result, which I hope meets your requirements.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Please find the attached pbix relevant to the case.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider Accept it &lt;EM&gt;&lt;STRONG&gt;as the solution &lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Dec 2024 07:56:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342800#M172436</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-25T07:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a visual line graph with cumulative sales for same month 1 year ago - ENTIRE MONTH</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342809#M172437</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="905149" data-lia-user-login="BBECQ" class="lia-mention lia-mention-user"&gt;BBECQ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To show the &lt;STRONG&gt;full cumulative sales for the same month last year&lt;/STRONG&gt;, update your DAX formula like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cumulative Sales LY =
CALCULATE(
    SUM('CSV Import Daily'[Sales Result]),
    ALLSELECTED('CSV Import Daily'),
    DATESMTD(SAMEPERIODLASTYEAR('CSV Import Daily'[DATE]))
)&lt;/LI-CODE&gt;&lt;P&gt;For dynamic "up to today's date" while showing the &lt;STRONG&gt;full last year month&lt;/STRONG&gt;:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cumulative Sales LY =
VAR _maxdate = MAX('CSV Import Daily'[DATE])
RETURN
CALCULATE(
    SUM('CSV Import Daily'[Sales Result]),
    ALLSELECTED('CSV Import Daily'),
    SAMEPERIODLASTYEAR(
        DATESBETWEEN(
            'CSV Import Daily'[DATE],
            STARTOFMONTH(_maxdate),
            ENDOFMONTH(_maxdate)
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution, this will help others!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If my response(s) assisted you in any way, don't forget to drop me a "&lt;STRONG&gt;Kudos&lt;/STRONG&gt;" &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;BR /&gt;Poojara&lt;BR /&gt;Data Analyst | MSBI Developer | Power BI Consultant&lt;BR /&gt;&lt;STRONG&gt;Consider Subscribing my YouTube for Beginners/Advance Concepts:&lt;/STRONG&gt;&amp;nbsp;&lt;A href="https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS" target="_self"&gt;https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Dec 2024 08:26:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-visual-line-graph-with-cumulative-sales-for-same/m-p/4342809#M172437</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2024-12-25T08:26:47Z</dc:date>
    </item>
  </channel>
</rss>

