<?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 Comparision of date in range of dates in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparision-of-date-in-range-of-dates/m-p/1399998#M25750</link>
    <description>&lt;P&gt;I am working on two tables Events &amp;amp; Events_Summary:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to compare an event date between the start date and end date of every cycle and then display the cycle name for every event. If there is no cycle on that date of the event, then we display 'No-Cycle'.&amp;nbsp; Can anyone help me with any solution in DAX? Is there any lookup for this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Data looks like this&lt;/P&gt;&lt;P&gt;Events&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;&lt;P&gt;Events_Summary&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;&lt;P&gt;Desired Output in Events_Table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 17:21:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-28T17:21:50Z</dc:date>
    <item>
      <title>Comparision of date in range of dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparision-of-date-in-range-of-dates/m-p/1399998#M25750</link>
      <description>&lt;P&gt;I am working on two tables Events &amp;amp; Events_Summary:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to compare an event date between the start date and end date of every cycle and then display the cycle name for every event. If there is no cycle on that date of the event, then we display 'No-Cycle'.&amp;nbsp; Can anyone help me with any solution in DAX? Is there any lookup for this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Data looks like this&lt;/P&gt;&lt;P&gt;Events&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;&lt;P&gt;Events_Summary&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;&lt;P&gt;Desired Output in Events_Table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:21:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparision-of-date-in-range-of-dates/m-p/1399998#M25750</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-28T17:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Comparision of date in range of dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparision-of-date-in-range-of-dates/m-p/1400217#M25755</link>
      <description>&lt;P&gt;Create a table visual holding the columns of the 1st table.&lt;/P&gt;
&lt;P&gt;Create&amp;nbsp; a measure as follows:&lt;/P&gt;
&lt;P&gt;Create a variable to hold event_date -&amp;gt; _edate&lt;/P&gt;
&lt;P&gt;Create a variable to find the cycle_name in the 2nd table by filtering the 2nd table to find row where cycle_start_date &amp;lt; edate and cycle_end_date &amp;gt; edate. -&amp;gt; _cycleName&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;_cycleName is empty return "No-cycle" otherwise return _cycleName&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:21:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparision-of-date-in-range-of-dates/m-p/1400217#M25755</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2020-09-28T19:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Comparision of date in range of dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparision-of-date-in-range-of-dates/m-p/1401613#M25796</link>
      <description>&lt;LI-CODE lang="csharp"&gt;[Cycle] = // calc column in Events
var __date = Events[Event_Date]
var __filteredForCycles =
    filter(
        Events_Summary,
        Events_Summary[Cycle_Start_Date] &amp;lt;= __date
        &amp;amp;&amp;amp;
        __date &amp;lt;= Events_Summary[Cycle_End_Date]
    )
var __cycleCount =
    COUNTROWS( __filteredForCycles )
var __cycle =
    MAXX(
        __filteredForCycles,
        Events_Summary[Cycyle_Name]
    )
var __output =
    switch( TRUE(),
        __cycleCount = 1, __cycle,
        __cycleCount = 0, "No-Cycle",
        
        // If your table has mutually exclusive
        // cycles, this should not happen.
        "Many Cycles"
    )
return
    __output&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:12:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparision-of-date-in-range-of-dates/m-p/1401613#M25796</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-29T10:12:35Z</dc:date>
    </item>
  </channel>
</rss>

