<?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: Monthly values by year, up to a specific date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2692451#M81110</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I see what you are trying to achieve. I should be possible. Here is an example:&lt;BR /&gt;&lt;BR /&gt;Data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;Relationship:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case you might not even need dax or jut use simple SUM(table[column])&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you only want last 3 years you can apply a visual level filter where you define this:&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;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Aug 2022 12:12:02 GMT</pubDate>
    <dc:creator>ValtteriN</dc:creator>
    <dc:date>2022-08-10T12:12:02Z</dc:date>
    <item>
      <title>Monthly values by year, up to a specific date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2691525#M81069</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a requirement to create a clustered column chart that can be filtered in a specific way by a date slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The chart needs to display sales by month (x-axis) and year legend. The user has a date slicer and need to be able to set the last date to display on the chart, but it needs to limit previous years also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This means if the user selects the date june 1th of 2022 in the slicer and we have 3 years of sales data, the chart would display&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;2022 : sales by month from 1/1/2022 to 6/1/2022&lt;/LI&gt;&lt;LI&gt;2021 : sales by month from 1/1/2021 to 6/1/2021&lt;/LI&gt;&lt;LI&gt;2020 : sales by month from 1/1/2020 to 6/1/2020&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data model is a simple fact table with sales linked to a calendar dimension.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it be possible to create one dax measure for this calculation ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 06:29:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2691525#M81069</guid>
      <dc:creator>Ta_Gaven</dc:creator>
      <dc:date>2022-08-10T06:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly values by year, up to a specific date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2691785#M81086</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;For LY calculation using SAMEPERIODLASTYEAR combined with calendar should do what you want. So e.g.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT&gt;&lt;FONT class=""&gt;CALCULATE &lt;FONT class=""&gt;(&lt;FONT class=""&gt; [measure], &lt;FONT class=""&gt;SAMEPERIODLASTYEAR &lt;FONT class=""&gt;(&lt;FONT class=""&gt; 'Calendar'[Date]&lt;FONT class=""&gt;))&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Alternatively you could construct the dates for DATESBETWEEN e.g. (use the _ly and _ly2 to create last year and two years ago measures:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;var&lt;SPAN&gt; _cy = &lt;SPAN&gt;MAX&lt;SPAN&gt;('Calendar'[Year])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;var&lt;SPAN&gt; _ly = _cy-&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;var&lt;SPAN&gt; _ly2 = &amp;nbsp;_cy-&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;var&lt;SPAN&gt; _cm = &lt;SPAN&gt;MAX&lt;SPAN&gt;('Calendar'[Month])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;var&lt;SPAN&gt; _cdate = &lt;SPAN&gt;MAX&lt;SPAN&gt;('Calendar'[Day])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;var&lt;SPAN&gt; _edate1 = &lt;SPAN&gt;DATE&lt;SPAN&gt;(_cy,_cm,_cdate)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;var&lt;SPAN&gt; _sdate = &lt;SPAN&gt;STARTOFYEAR&lt;SPAN&gt;('Calendar'[Date])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;return&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;SPAN&gt;([Measure 8],&lt;SPAN&gt;DATESBETWEEN&lt;SPAN&gt;('Calendar'[Date],_sdate,_edate1))&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;My LinkedIn: &lt;A href="https://www.linkedin.com/in/n%C3%A4ttiahov-00001/" target="_blank" rel="noopener"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 Aug 2022 08:33:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2691785#M81086</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-08-10T08:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly values by year, up to a specific date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2691880#M81088</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought about having more than 1 measure. However, the user has to be able to see all the years available from the dataset, so that means we would have to create an undefinite number of measure (y, y-1, y-2, ...).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you think there is a way to do this in a single measure with dax ?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 08:56:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2691880#M81088</guid>
      <dc:creator>Ta_Gaven</dc:creator>
      <dc:date>2022-08-10T08:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly values by year, up to a specific date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2692451#M81110</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I see what you are trying to achieve. I should be possible. Here is an example:&lt;BR /&gt;&lt;BR /&gt;Data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;Relationship:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case you might not even need dax or jut use simple SUM(table[column])&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you only want last 3 years you can apply a visual level filter where you define this:&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;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 12:12:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2692451#M81110</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-08-10T12:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly values by year, up to a specific date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2692506#M81114</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But in your case it takes the whole month, right ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my requirement I have to filter up to the date selected, meaning if the date 6/15/2022 is selected, the sum should from 1/1/YYYY to 6/15/YYYY for each year.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 12:31:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Monthly-values-by-year-up-to-a-specific-date/m-p/2692506#M81114</guid>
      <dc:creator>Ta_Gaven</dc:creator>
      <dc:date>2022-08-10T12:31:05Z</dc:date>
    </item>
  </channel>
</rss>

