<?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 Accumulated Formula between 2 years in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulated-Formula-between-2-years/m-p/1872704#M40163</link>
    <description>&lt;P&gt;Hello I'm new to dax syntaxe and I have an issue, I want to create a mesure that calculate the accumulated value between 2 years 2021 and 2022, that's mean in 2021 it get the normal budget value but in 2022 it get the sum of the budget for 2021 and 2022.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 May 2021 09:30:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-05-31T09:30:34Z</dc:date>
    <item>
      <title>Accumulated Formula between 2 years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulated-Formula-between-2-years/m-p/1872704#M40163</link>
      <description>&lt;P&gt;Hello I'm new to dax syntaxe and I have an issue, I want to create a mesure that calculate the accumulated value between 2 years 2021 and 2022, that's mean in 2021 it get the normal budget value but in 2022 it get the sum of the budget for 2021 and 2022.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 09:30:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulated-Formula-between-2-years/m-p/1872704#M40163</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-31T09:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulated Formula between 2 years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulated-Formula-between-2-years/m-p/1872782#M40165</link>
      <description>&lt;P&gt;Hey&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try the following approach:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Accumulated =
VAR vCurrentYear = YEAR( MAX( Abfrage1[date] ) )
RETURN
    IF(
        vCurrentYear = 2022,
        CALCULATE(
            SUM( Abfrage1[budget] ),
            DATESINPERIOD(
                'Date'[Date],
                MAX( 'Date'[Date] ),
                -1,
                YEAR
            )
        ),
        SUM( Abfrage1[budget] )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Be aware that for that approach and for many that use time intelligence you need a date table:&lt;/P&gt;&lt;P&gt;&lt;A href="https://softcrylic.com/blogs/power-bi-for-beginners-how-to-create-a-date-table-in-power-bi/" target="_blank"&gt;Power Bi for Beginners: How to create a Date Table in Power Bi - Softcrylic&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;If you need any help please let me know.&lt;/DIV&gt;&lt;DIV&gt;If I answered your question I would be happy if you could mark my post as a solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; and give it a thumbs up &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Best regards&lt;/DIV&gt;&lt;DIV&gt;Denis&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Blog: &lt;A title="Click here!" href="https://whatthefact.bi/?utm_source=powerbicommunity&amp;amp;utm_medium=link&amp;amp;utm_campaign=forum" target="_blank" rel="noopener"&gt;&lt;U&gt;WhatTheFact.bi&lt;/U&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;Follow me: &lt;A title="Click here!" href="https://twitter.com/DenSelimovic" target="_blank" rel="noopener"&gt;&lt;U&gt;twitter.com/DenSelimovic&lt;/U&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 10:03:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulated-Formula-between-2-years/m-p/1872782#M40165</guid>
      <dc:creator>selimovd</dc:creator>
      <dc:date>2021-05-31T10:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Accumulated Formula between 2 years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulated-Formula-between-2-years/m-p/1872918#M40168</link>
      <description>&lt;P&gt;First of all thank you very much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="2744" data-lia-user-login="selimovd" class="lia-mention lia-mention-user"&gt;selimovd&lt;/a&gt;&amp;nbsp; for the quick response.&lt;/P&gt;&lt;P&gt;I just did some changes like&amp;nbsp; (''Abfrage1'[date] in state of Date['Date']) I also changed SUM( Abfrage1[budget] ) by&amp;nbsp;MAX( Abfrage1[budget] ) in the end of the query and the result is fine for the year 2021, but for the year 2022 it's not working like I want, may be I haven't clarify enough but the sum must be like this exemple : date :01/01/2021 budget :200,&amp;nbsp;date :01/01/2022 budget :300, -&amp;gt; accumulated mesure for 2021 :200 which is ok by our work , accumulated mesure for 2022 : 500 !! so the sum must be like this:&amp;nbsp;&amp;nbsp;01/01/2021 with&amp;nbsp;01/01/2022, then&amp;nbsp;01/02/2021 with&amp;nbsp;01/02/2022 ... by the acctual formula I think it calculate the sum of the hole year but what I want is to calculate the sum between the same dates ex: (01/01/2021 and 01/01/2022) but between the 2 years. I hope you get the idea&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="2744" data-lia-user-login="selimovd" class="lia-mention lia-mention-user"&gt;selimovd&lt;/a&gt;&amp;nbsp;and thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 11:34:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Accumulated-Formula-between-2-years/m-p/1872918#M40168</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-31T11:34:28Z</dc:date>
    </item>
  </channel>
</rss>

