<?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 Measure to show data depending on the date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-show-data-depending-on-the-date/m-p/2135320#M49029</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="162742" data-lia-user-login="LowerB" class="lia-mention lia-mention-user"&gt;LowerB&lt;/a&gt; , You need break down into few problem and try to solve it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to use a common date table and join it with date of all tbales then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example of month data&lt;/P&gt;
&lt;P&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))&lt;BR /&gt;last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))&lt;BR /&gt;last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))&lt;BR /&gt;next month Sales = CALCULATE(SUM(Sales[Sales Amount]),nextmonth('Date'[Date]))&lt;BR /&gt;this month = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Till Date last month =&lt;/P&gt;
&lt;P&gt;var _max = eomonth(maxx(allselected('Date'), 'Date'[date]) , -1)&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;CALCULATE(SUM(Sales[Sales Amount]), filter(all('Date'), 'Date'[date] &amp;lt;=_max) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;next three&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),3,MONTH)) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;last three&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),13,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;last 3 before 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-3),13,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Oct 2021 14:57:41 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-10-14T14:57:41Z</dc:date>
    <item>
      <title>Creating a Measure to show data depending on the date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-show-data-depending-on-the-date/m-p/2135166#M49022</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is my first post and I'm fairly new to Power BI, so if I do something wrong please let me know.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Situation:&lt;/P&gt;&lt;P&gt;I have a matrix, where I display costs and revenue for each month of the year. This works great so far when the Values come from one of my tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Issue:&lt;/P&gt;&lt;P&gt;I would like to display different values for different time frames depending on the current date (month) e.g.:&lt;/P&gt;&lt;P&gt;This month (October) I would like to display the data as the following:&lt;/P&gt;&lt;P&gt;Values from Source 1: Up until the previous month (in this example: up until September)&lt;/P&gt;&lt;P&gt;Values from Source 2: Current month (in this example: October)&lt;/P&gt;&lt;P&gt;Values from Source 3: +1 &amp;amp; +2 months from current month (in this example: November &amp;amp; December)&lt;/P&gt;&lt;P&gt;Values from Source 4: +3 &amp;amp; +4 &amp;amp; +5 months from current month (in this example: Jan, Feb, March)&lt;/P&gt;&lt;P&gt;Values from Source 5: +6 and following (in this example: April, May, June...etc.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried various measures but it either doesnt show all the correct data or it clips off the data for each year (taking the same "cut-off" for every year, even in the past, when the past should only display values from Source 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't found a proper solution in any other posts and when I creatively tried to combine different solutions it didn't give me the result I was looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope anyone out there is able to help me somehow or stirr me in the right directions as I think I am mainly blocking myself right now because I'm frustrated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help, even if it is telling me I'm in the wrong place and directing me on where to go with this issue! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 13:54:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-show-data-depending-on-the-date/m-p/2135166#M49022</guid>
      <dc:creator>LowerB</dc:creator>
      <dc:date>2021-10-14T13:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Measure to show data depending on the date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-show-data-depending-on-the-date/m-p/2135320#M49029</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="162742" data-lia-user-login="LowerB" class="lia-mention lia-mention-user"&gt;LowerB&lt;/a&gt; , You need break down into few problem and try to solve it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to use a common date table and join it with date of all tbales then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example of month data&lt;/P&gt;
&lt;P&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))&lt;BR /&gt;last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))&lt;BR /&gt;last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))&lt;BR /&gt;next month Sales = CALCULATE(SUM(Sales[Sales Amount]),nextmonth('Date'[Date]))&lt;BR /&gt;this month = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Till Date last month =&lt;/P&gt;
&lt;P&gt;var _max = eomonth(maxx(allselected('Date'), 'Date'[date]) , -1)&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;CALCULATE(SUM(Sales[Sales Amount]), filter(all('Date'), 'Date'[date] &amp;lt;=_max) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;next three&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),3,MONTH)) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;last three&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),13,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;last 3 before 3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-3),13,MONTH))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 14:57:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Measure-to-show-data-depending-on-the-date/m-p/2135320#M49029</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-10-14T14:57:41Z</dc:date>
    </item>
  </channel>
</rss>

