<?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: Calculate Sales until the Selected Year (row by row) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3102141#M109114</link>
    <description>&lt;P&gt;This works like magic. I learned a cool technique.&lt;/P&gt;&lt;P&gt;Thank you very much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2023 17:29:10 GMT</pubDate>
    <dc:creator>RoshanK</dc:creator>
    <dc:date>2023-02-27T17:29:10Z</dc:date>
    <item>
      <title>Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3099723#M108915</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've sales &amp;amp; calendar table. Simple data model. Table for reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;What I am trying to do is ; When a user selects Year, sales until that Year is shown.&lt;/P&gt;&lt;P&gt;For example, if 2020 is selected then Sales for 2018,2019, and 2020 is shown.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help/guidance will be appreciated. Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Feb 2023 16:36:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3099723#M108915</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-02-26T16:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3099812#M108928</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="495773" data-lia-user-login="RoshanK" class="lia-mention lia-mention-user"&gt;RoshanK&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Create a disconnected Year table like&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Year =
-- calculated table 
ALLNOBLANKROW ( 'Date'[Year] )&lt;/LI-CODE&gt;
&lt;P&gt;Make sure this table is completely disconnected from any other table in the model.&lt;/P&gt;
&lt;P&gt;Then the measure would be&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Acummulated Liters =
CALCULATE ( [Liters], KEEPFILTERS ( 'Date'[Liters] &amp;lt;= MAX ( Year[Year] ) ) )&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 26 Feb 2023 10:52:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3099812#M108928</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-26T10:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3100083#M108953</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;Acummulated Liters =
CALCULATE ( [Liters], KEEPFILTERS ( 'Date'[Liters] &amp;lt;= MAX ( Year[Year] ) ) )&lt;/PRE&gt;&lt;P&gt;In this measure, did you mean Date[Year] &amp;lt;= Max(Year[Year])?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 26 Feb 2023 19:29:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3100083#M108953</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-02-26T19:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3100402#M108969</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="495773" data-lia-user-login="RoshanK" class="lia-mention lia-mention-user"&gt;RoshanK&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes. Sorry for the typo.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 02:19:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3100402#M108969</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-27T02:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3100727#M108993</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created disconnected table, like you suggested.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here is the result from the measure you suggested;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;First Challenge:&lt;/STRONG&gt; Accumulated Liters is cummulative liters. What I was looking for is Liters for selected year &amp;amp; month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Second Challenge:&amp;nbsp;&lt;/STRONG&gt;If I filter using Disconnected Year, it doesn't work. For example: when Year 2022 is selected, I still want sales for 2018,2019,2020,&amp;amp;2021 (row by row). Not the result below:&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;Any suggestion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 07:01:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3100727#M108993</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-02-27T07:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3100757#M108997</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="495773" data-lia-user-login="RoshanK" class="lia-mention lia-mention-user"&gt;RoshanK&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The Year from the disconnected table will be used only in slicer not in the table visual. Tis table doesn't habe to be a complete Date table, rather it can be only a single column table that contains 5 rows (the values of the 5 avialable years) you can use the code in my original reply to create it or just insert manually.&lt;/P&gt;
&lt;P&gt;In the table visual you can use the year column from your connected calendar table and the code can be&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Acummulated Liters =
CALCULATE ( [Liters], KEEPFILTERS ( 'Calendar'[Years] &amp;lt;= MAX ( 'Year'[Year] ) ) )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 27 Feb 2023 07:26:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3100757#M108997</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-27T07:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3101717#M109073</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used exactly the same logic you suggested. For some reasons, it is not working!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In column: Year from Calendar &amp;amp; Accumulated Liters.&lt;/P&gt;&lt;P&gt;Year Slicer from disconnected table created using ALLNOBLANKROW()&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance! In the meantime I will be exploring other logics to solve this challenge.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 14:55:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3101717#M109073</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-02-27T14:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3101846#M109084</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="495773" data-lia-user-login="RoshanK" class="lia-mention lia-mention-user"&gt;RoshanK&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Are you sure the year column used in the table is from 'Calendar' table and that the 'Calendar' table is connected to the fact table?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 15:35:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3101846#M109084</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-27T15:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3101933#M109098</link>
      <description>&lt;P&gt;Yes. Take a look here ( Calendar, Fact table, &amp;amp; Disconnected table)!&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 16:03:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3101933#M109098</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-02-27T16:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3102096#M109108</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="495773" data-lia-user-login="RoshanK" class="lia-mention lia-mention-user"&gt;RoshanK&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you are right. Please refer to attached sample file&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Acummulated Liters = 
VAR CalendarYear = MAX ( 'Calendar'[Year] )
VAR YearYear = MAX ( 'Year'[Year] )
RETURN
    IF (
        CalendarYear &amp;lt;= YearYear,
        CALCULATE ( 
            [Total Liters], 
            'Calendar'[Year] &amp;lt;= MIN ( CalendarYear, YearYear )
        )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 27 Feb 2023 17:07:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3102096#M109108</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-02-27T17:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Sales until the Selected Year (row by row)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3102141#M109114</link>
      <description>&lt;P&gt;This works like magic. I learned a cool technique.&lt;/P&gt;&lt;P&gt;Thank you very much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 17:29:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Sales-until-the-Selected-Year-row-by-row/m-p/3102141#M109114</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-02-27T17:29:10Z</dc:date>
    </item>
  </channel>
</rss>

