<?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: Not allowing for date within Range in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-allowing-for-date-within-Range/m-p/1079289#M15192</link>
    <description>&lt;P&gt;So changing the first part of the Filter to look at Phase Start date helped with that condition. However I have another state where there are only end dates. So data looks something like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Construction Stages&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;StageID&lt;/TD&gt;&lt;TD&gt;SiteID&lt;/TD&gt;&lt;TD&gt;StageName&lt;/TD&gt;&lt;TD&gt;StageComplete&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Stage 1&lt;/TD&gt;&lt;TD&gt;2019-5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Stage 2&lt;/TD&gt;&lt;TD&gt;2019-9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Stage 1&lt;/TD&gt;&lt;TD&gt;2019-7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Program Stages&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;SiteID&lt;/TD&gt;&lt;TD&gt;ProgramType&lt;/TD&gt;&lt;TD&gt;DateProgramAvailable&lt;/TD&gt;&lt;TD&gt;Construction Stage ID (calculated column)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Dept1&lt;/TD&gt;&lt;TD&gt;2019-5&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Dept2&lt;/TD&gt;&lt;TD&gt;2019-8&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Dept3&lt;/TD&gt;&lt;TD&gt;2019-6&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, I only return a Stage ID when the year &amp;amp; month match, but as you see, I don't have start dates, nor do I want to have to include start dates, I'd prefer to infer it from the data available, ie one stage will be complete before the next stage "starts". The point is to dynamically solve for what Construction Stage a Program Stage will fall into, rather than having the user have to define that information in advance. It allows the user to input construction and program stages seperate from each other and then see where the chips fall based on their input.&lt;/P&gt;</description>
    <pubDate>Thu, 07 May 2020 13:24:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-05-07T13:24:09Z</dc:date>
    <item>
      <title>Not allowing for date within Range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-allowing-for-date-within-Range/m-p/1077161#M15120</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the following formula for a custom column (that I pulled off of here, somewhere) to find if a row matches to a phase.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;Construction Phase ID = &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VAR StageDate = prog_SiteProgramStages[Program Available - Year]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; MAXX(&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; FILTER(&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; site_ConstructionPhases,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; site_ConstructionPhases[Year Complete] &amp;lt;= StageDate &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; StageDate &amp;lt;= site_ConstructionPhases[Year Complete]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; site_ConstructionPhases[PhaseID]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;It works, except that it is basically performing an Exact Match. The Phases cover mutliple years, so a Row whose year falls in the time span of the Phase doesn't return a result. But if the row's year matches the end year for a phase the result returns correctly. How do a I modify to allow for the row's date to fall within each range defined by each Phase?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-R&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 May 2020 20:10:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-allowing-for-date-within-Range/m-p/1077161#M15120</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-06T20:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing for date within Range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-allowing-for-date-within-Range/m-p/1077260#M15125</link>
      <description>&lt;P&gt;Difficutl without data to visualize.&amp;nbsp;Please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I'm guessing it involves checking if your date is greater than or equal to Year Started?&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 21:04:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-allowing-for-date-within-Range/m-p/1077260#M15125</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-05-06T21:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Not allowing for date within Range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-allowing-for-date-within-Range/m-p/1079289#M15192</link>
      <description>&lt;P&gt;So changing the first part of the Filter to look at Phase Start date helped with that condition. However I have another state where there are only end dates. So data looks something like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Construction Stages&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;StageID&lt;/TD&gt;&lt;TD&gt;SiteID&lt;/TD&gt;&lt;TD&gt;StageName&lt;/TD&gt;&lt;TD&gt;StageComplete&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Stage 1&lt;/TD&gt;&lt;TD&gt;2019-5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Stage 2&lt;/TD&gt;&lt;TD&gt;2019-9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Stage 1&lt;/TD&gt;&lt;TD&gt;2019-7&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Program Stages&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;SiteID&lt;/TD&gt;&lt;TD&gt;ProgramType&lt;/TD&gt;&lt;TD&gt;DateProgramAvailable&lt;/TD&gt;&lt;TD&gt;Construction Stage ID (calculated column)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Dept1&lt;/TD&gt;&lt;TD&gt;2019-5&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Dept2&lt;/TD&gt;&lt;TD&gt;2019-8&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Dept3&lt;/TD&gt;&lt;TD&gt;2019-6&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, I only return a Stage ID when the year &amp;amp; month match, but as you see, I don't have start dates, nor do I want to have to include start dates, I'd prefer to infer it from the data available, ie one stage will be complete before the next stage "starts". The point is to dynamically solve for what Construction Stage a Program Stage will fall into, rather than having the user have to define that information in advance. It allows the user to input construction and program stages seperate from each other and then see where the chips fall based on their input.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 13:24:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-allowing-for-date-within-Range/m-p/1079289#M15192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-07T13:24:09Z</dc:date>
    </item>
  </channel>
</rss>

