<?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: Filter date in Calculate function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2316748#M57733</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Could you please tell me what is your desired output？&lt;BR /&gt;I have created a simple sample.&lt;/P&gt;
&lt;P&gt;And the formula works well.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;mesure december = 
var MAXI = month(LASTDATE(Data[Date]))
return

CALCULATE(sum(Data[Value]) , month(Data[Date]) = MAXI)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If it is possible, please provide your pbix file without privacy information and desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Community Support Team _ Polly&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Feb 2022 03:10:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-02-03T03:10:54Z</dc:date>
    <item>
      <title>Filter date in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2308557#M57312</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am posting because I am pretty new on Power BI and I seem to be stuck on a particular issue I hope you could help me with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is the following :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a list of number, related to dates. It allows me to make table with value per month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to isolate the value of the last month with a code as below but it does not work and i do not understand why...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;mesure december = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;MAXI&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;month&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;LASTDATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Data[Date]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Data[Value]&lt;/SPAN&gt;&lt;SPAN&gt;) , &lt;/SPAN&gt;&lt;SPAN&gt;month&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Data[Date]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;MAXI&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please let me know if it is understandable and thank you in advance for your help&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jan 2022 21:35:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2308557#M57312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-28T21:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Filter date in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2308985#M57345</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For LM calculations I recommend using functions like&amp;nbsp;PREVIOUSMONTH,&amp;nbsp; DATEADD or PARARALLELPERIOD.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;e.g.&amp;nbsp;CALCULATE(sum(Data[Value]) ,&amp;nbsp;PREVIOUSMONTH('Calendar'[Date]))&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"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jan 2022 17:00:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2308985#M57345</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-01-29T17:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Filter date in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2316748#M57733</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Could you please tell me what is your desired output？&lt;BR /&gt;I have created a simple sample.&lt;/P&gt;
&lt;P&gt;And the formula works well.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;mesure december = 
var MAXI = month(LASTDATE(Data[Date]))
return

CALCULATE(sum(Data[Value]) , month(Data[Date]) = MAXI)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If it is possible, please provide your pbix file without privacy information and desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Community Support Team _ Polly&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 03:10:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2316748#M57733</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-03T03:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filter date in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2329138#M58445</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the late reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will attache the related document do you know how to proceed ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I have with my calculation is the following :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The total on column 2 focus on last month and is ok (310). But i don't understand why the others month that should be filter appear in the list (january to november)&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 20:31:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2329138#M58445</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-09T20:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Filter date in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2329275#M58456</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;If you want to make a measure Total Amt = SUM(Data[Vlue])&lt;/P&gt;&lt;P&gt;Then you can do:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Last Month := &lt;/SPAN&gt;&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class=""&gt;([Total Amt&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;PREVIOUSMONTH&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'Dates'&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;Date&lt;/SPAN&gt;&lt;SPAN class=""&gt;]))&amp;nbsp; &amp;nbsp; or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Last Month =&amp;nbsp; &lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;(SUM(&lt;SPAN&gt;Data[Value]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;PREVIOUSMONTH&lt;/SPAN&gt;(&lt;SPAN class=""&gt;'Dates'&lt;/SPAN&gt;[&lt;SPAN class=""&gt;Date&lt;/SPAN&gt;]))&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;This should be OK for you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 21:59:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-date-in-Calculate-function/m-p/2329275#M58456</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-02-09T21:59:32Z</dc:date>
    </item>
  </channel>
</rss>

