<?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: Date filter in Calculate function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732530#M1833</link>
    <description>&lt;P&gt;Not sure if I understand you correctly, but the following measure is also displaying values for periods that don't exisit in the actuals table;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Cumulative Actual Amount = &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;CALCULATE ( SUM ( Actual[Actual_Amount] ) ,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;FILTER ( ALL ( 'Calendar' ) , 'Calendar' [Date] &amp;lt;= MAX ( 'Calendar'[Date] ) ) )&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 05 Jul 2019 08:52:47 GMT</pubDate>
    <dc:creator>avanderschilden</dc:creator>
    <dc:date>2019-07-05T08:52:47Z</dc:date>
    <item>
      <title>Date filter in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732003#M1799</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Good afternoon:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to make a measure that reflects in a table the total cost Budgeted by day, month and year ONLY UNTIL the last date of the "Real" table.&lt;/SPAN&gt; &lt;SPAN&gt;I have (among others) the following tables in my data model:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Calendar&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Ppto: Table of costs budgeted from 01/01/2019 to 31/12/2019&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Real: Table of Actual Accounting costs from &lt;STRONG&gt;&lt;SPAN&gt;01/01/2019 to 28/06/2019&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The result that I intend to obtain must be equal to what the following measure would give me:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Total = calculate(sum(Ppto[importe]);filter(Calendario;Calendario[Date]&amp;lt;=VALUE(28/06/2019)))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;The question is: With what dax expression can I substitute VALUE (28/06/2019) for the FINAL DATE of the "Real" table ? (28/06/2019 is the last date of the "Real" table).&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;For example, if I use this measure: "calculate (sum (Ppto [importe); filter (Calendario; Calendario [Date] &amp;lt;= max (Real [date]))" the result I get&lt;STRONG&gt;&lt;SPAN&gt; is incorrect because&lt;/SPAN&gt;&lt;/STRONG&gt; in the table "Real"&lt;/SPAN&gt; there are not all the dates that exist in the" Calendario "table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;José Luis&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 16:02:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732003#M1799</guid>
      <dc:creator>joseluis1969</dc:creator>
      <dc:date>2019-07-04T16:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Date filter in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732033#M1806</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What about this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Measure = &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;VAR MaxDateBalance = MAX('Table'[Date])&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;RETURN CALCULATE(SUM('Table'[Column]),FILTER(ALL('Date'),'Date'[Date]&amp;lt;MaxDateBalance))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Jul 2019 17:29:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732033#M1806</guid>
      <dc:creator>avanderschilden</dc:creator>
      <dc:date>2019-07-04T17:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date filter in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732491#M1830</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much for your answer.&lt;/SPAN&gt; &lt;SPAN&gt;The measurement you indicate does not work correctly, I try to explain it with the following image:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 08:27:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732491#M1830</guid>
      <dc:creator>joseluis1969</dc:creator>
      <dc:date>2019-07-05T08:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Date filter in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732530#M1833</link>
      <description>&lt;P&gt;Not sure if I understand you correctly, but the following measure is also displaying values for periods that don't exisit in the actuals table;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Cumulative Actual Amount = &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;CALCULATE ( SUM ( Actual[Actual_Amount] ) ,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;FILTER ( ALL ( 'Calendar' ) , 'Calendar' [Date] &amp;lt;= MAX ( 'Calendar'[Date] ) ) )&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 05 Jul 2019 08:52:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732530#M1833</guid>
      <dc:creator>avanderschilden</dc:creator>
      <dc:date>2019-07-05T08:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Date filter in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732532#M1834</link>
      <description>&lt;P&gt;"&lt;STRONG&gt;&lt;SPAN&gt;The question is: With what dax expression can I substitute VALUE (28/06/2019) for the FINAL DATE of the "Real" table ? (28/06/2019 is the last date of the "Real" table)."&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, that's rather simple:&lt;/P&gt;&lt;PRE&gt;[Very Last Date in Real] :=
calculate(
    max( Real[Date] ),
    all( Real )
)&lt;/PRE&gt;&lt;P&gt;and here's how you'd use it:&lt;/P&gt;&lt;PRE&gt;var __lastDateInReal = [Last Date in Real]
return
calculate (
	sum ( Ppto[importe] );
	KEEPFILTERS( Calendario[Date] &amp;lt;= __lastDateInReal )
)&lt;/PRE&gt;&lt;P&gt;if you want to intersect filters on Calendario that are coming from the outer context... and this is probably what you want to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 08:54:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/732532#M1834</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-05T08:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date filter in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/1043516#M14030</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How i can use formula which help me make sameperiod last month.&lt;/P&gt;&lt;P&gt;Now i use this, but it's error (red text)&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SPLM = CALCULATE([mln st];REPORT_IMS[VISIT YEAR]=YEAR(TODAY());'REPORT_IMS'[VISIT MONTH]=MONTH(TODAY())-1;REPORT_IMS[WORKING DAY]&lt;FONT color="#FF0000"&gt;&amp;lt;=CALCULATE&lt;/FONT&gt;(MAX(REPORT_IMS[WORKING DAY];DATESMTD(REPORT_IMS[VISIT DATE]))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How i can fix it?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Basically i need sales (mln st) in previous month in same count of working days in this month&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Apr 2020 07:52:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/1043516#M14030</guid>
      <dc:creator>answeriver</dc:creator>
      <dc:date>2020-04-23T07:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Date filter in Calculate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/2595761#M74921</link>
      <description>&lt;P&gt;Hello, Thank you for the help.&lt;/P&gt;&lt;P&gt;In my case, I want to get the max date depending on the filter and go back a year.&lt;/P&gt;&lt;P&gt;For example, if the selected date on the Real date filter is 6/22/2022. I want to filter another customer table where customer date equals 6/22/2021.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 18:54:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-filter-in-Calculate-function/m-p/2595761#M74921</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-22T18:54:29Z</dc:date>
    </item>
  </channel>
</rss>

