<?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 Filter is not returning data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1722935#M35641</link>
    <description>&lt;P&gt;I have a date table and its populated upto yesterday (14/3/2021). I'm trying to get the date for a week ago based on today, now when I run this query it returns no data,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  'Calendar'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;  DATEADD&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt; &lt;SPAN&gt;'Calendar'[CalendarDate]&lt;/SPAN&gt;, &lt;SPAN&gt;7&lt;/SPAN&gt;, &lt;SPAN&gt;DAY&lt;/SPAN&gt; &lt;SPAN&gt;)&lt;/SPAN&gt; = &lt;SPAN&gt;UTCTODAY&lt;/SPAN&gt; &lt;SPAN&gt;()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;So I tested this to try and narrow down where its going wrong so I tried the following which should be equivilant to the above but still no results&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  'Calendar'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;  DATEADD&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt; &lt;SPAN&gt;'Calendar'[CalendarDate]&lt;/SPAN&gt;, &lt;SPAN&gt;7&lt;/SPAN&gt;, &lt;SPAN&gt;DAY&lt;/SPAN&gt; &lt;SPAN&gt;)&lt;/SPAN&gt; = DATE(2021,3,15)&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Next I tried this, using yesterday's result and voila I get the expected date&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  'Calendar'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;  DATEADD&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt; &lt;SPAN&gt;'Calendar'[CalendarDate]&lt;/SPAN&gt;, &lt;SPAN&gt;7&lt;/SPAN&gt;, &lt;SPAN&gt;DAY&lt;/SPAN&gt; &lt;SPAN&gt;)&lt;/SPAN&gt; = DATE(2021,3,14)&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;It is as if it needs to find the value in the table before it can do the filter but that doesnt make a lot of sense. Can anyone provide some clarity on this or a different solution.&amp;nbsp;&lt;/P&gt;&lt;H6&gt;We are using custom calendars so please dont suggest full years or time intelligence funcitons.&lt;/H6&gt;</description>
    <pubDate>Mon, 15 Mar 2021 15:02:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-03-15T15:02:37Z</dc:date>
    <item>
      <title>Filter is not returning data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1722935#M35641</link>
      <description>&lt;P&gt;I have a date table and its populated upto yesterday (14/3/2021). I'm trying to get the date for a week ago based on today, now when I run this query it returns no data,&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  'Calendar'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;  DATEADD&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt; &lt;SPAN&gt;'Calendar'[CalendarDate]&lt;/SPAN&gt;, &lt;SPAN&gt;7&lt;/SPAN&gt;, &lt;SPAN&gt;DAY&lt;/SPAN&gt; &lt;SPAN&gt;)&lt;/SPAN&gt; = &lt;SPAN&gt;UTCTODAY&lt;/SPAN&gt; &lt;SPAN&gt;()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;So I tested this to try and narrow down where its going wrong so I tried the following which should be equivilant to the above but still no results&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  'Calendar'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;  DATEADD&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt; &lt;SPAN&gt;'Calendar'[CalendarDate]&lt;/SPAN&gt;, &lt;SPAN&gt;7&lt;/SPAN&gt;, &lt;SPAN&gt;DAY&lt;/SPAN&gt; &lt;SPAN&gt;)&lt;/SPAN&gt; = DATE(2021,3,15)&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Next I tried this, using yesterday's result and voila I get the expected date&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  'Calendar'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;  DATEADD&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt; &lt;SPAN&gt;'Calendar'[CalendarDate]&lt;/SPAN&gt;, &lt;SPAN&gt;7&lt;/SPAN&gt;, &lt;SPAN&gt;DAY&lt;/SPAN&gt; &lt;SPAN&gt;)&lt;/SPAN&gt; = DATE(2021,3,14)&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;It is as if it needs to find the value in the table before it can do the filter but that doesnt make a lot of sense. Can anyone provide some clarity on this or a different solution.&amp;nbsp;&lt;/P&gt;&lt;H6&gt;We are using custom calendars so please dont suggest full years or time intelligence funcitons.&lt;/H6&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:02:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1722935#M35641</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-15T15:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filter is not returning data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1723070#M35646</link>
      <description>&lt;P&gt;The date returned from DATEADD has to be in the column of dates already.&lt;/P&gt;
&lt;P&gt;It's this bit&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;The result table includes only dates that exist in the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;dates&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;column&lt;/SPAN&gt;"&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 16:18:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1723070#M35646</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2021-03-15T16:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter is not returning data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1724456#M35685</link>
      <description>&lt;P&gt;I agree that the result table will only be dates that exist and the date does exist, taking the above example 15-7 should return the 8th which does exist but it returns nothing, however if I use 14-7 where 14 is the last date on the table it correctly returns the 7. If this is by design, how do I return the the date 7 days ago from today?&amp;nbsp;The DATEADD funtion only accepts a column so I cant do a DATEADD on UTCTODAY or a variable. In SQL this is no problem so how do I solve it with DAX because changing the date table is not an option as its not our table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 08:32:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1724456#M35685</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-16T08:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filter is not returning data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1725209#M35706</link>
      <description>&lt;P&gt;You've lost me with the logic there.&amp;nbsp; At no point is 7 subtracted from 15. This bit:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DATEADD ( 'Calendar'[CalendarDate], 7, DAY )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;adds 7 days to each date (in context) in the Calendar table. If the result is a date in the table, it will be returned.&amp;nbsp; So nothing will be returned from 8th March onwards.&lt;/P&gt;
&lt;P&gt;----&lt;/P&gt;
&lt;P&gt;You can solve this by using arithmetic operators (+, -) to make a date, for example&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;TODAY() - 7&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 16 Mar 2021 13:02:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1725209#M35706</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2021-03-16T13:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filter is not returning data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1732412#M35915</link>
      <description>&lt;P&gt;I was not aware that you can do UTCTODAY() - 7. This is very implicit, and reading it its not clear what 7 is, Days, Minutes or Years etc&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 09:24:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-is-not-returning-data/m-p/1732412#M35915</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-19T09:24:01Z</dc:date>
    </item>
  </channel>
</rss>

