<?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: Intersect on Temporary Tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2767868#M86026</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="151306" data-lia-user-login="latimeria" class="lia-mention lia-mention-user"&gt;latimeria&lt;/a&gt;, I must not have been following the DAX logic properly in Greg's original answer. I tried the longer formula posted above and it worked perfectly. Thank you both so much for helping me out with this! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2022 15:55:03 GMT</pubDate>
    <dc:creator>Dawson16</dc:creator>
    <dc:date>2022-09-14T15:55:03Z</dc:date>
    <item>
      <title>Intersect on Temporary Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2765191#M85865</link>
      <description>&lt;P&gt;Hello, I am trying to create a calculated column in my table that specifies whether the activity occurs during a certain month. For example, I want the calculated column to say "Yes" if the Activity occurs at any point the month before the snapshot date and "No" if not. Snapshots are taken each month of all of the activities, so start and finish dates can vary between them. Here is an example table to show what I'm trying for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I figured that a formula like the following would work, but it's not quite right. Does anyone know of a solution to this?&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;In Date Range? = &lt;/EM&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;var ActListDates=DATESBETWEEN('Date'[Date],Table[Start Date], Table[Finish Date])&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var PriorMonthListDates = PREVIOUSMONTH(Table[Snapshot Date])&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Return&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if(COUNTROWS(INTERSECT(ActListDates, PriorMonthListDates))&amp;gt;=1, "Yes", "No")&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 18:51:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2765191#M85865</guid>
      <dc:creator>Dawson16</dc:creator>
      <dc:date>2022-09-13T18:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect on Temporary Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2765304#M85870</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="409037" data-lia-user-login="Dawson16" class="lia-mention lia-mention-user"&gt;Dawson16&lt;/a&gt;&amp;nbsp;You could do this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;In Date Range? Column = 
  VAR __MonthBeforeSnapshot = EOMONTH([Snapshot Date]),-1)
  VAR __FinishDate = EOMONTH([Snapshot Date],0)
RETURN
  IF(__MonthBeforeSnapshot = __FinishDate,"Yes","No")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 13 Sep 2022 20:03:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2765304#M85870</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-09-13T20:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect on Temporary Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2765394#M85876</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;Thank you for your quick response! Unfortunately, this doesn't solve what I'm going for with this problem. I've attached some better sample data in a screenshot below as well as showed the formula I'm using. The rows I have highlighted yellow are giving improper results since their date ranges do coincide with the month preceding the respective snapshot dates. Please let me know if I can include any further images or data as needed to help clear up this issue.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 20:54:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2765394#M85876</guid>
      <dc:creator>Dawson16</dc:creator>
      <dc:date>2022-09-13T20:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect on Temporary Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2765460#M85880</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="409037" data-lia-user-login="Dawson16" class="lia-mention lia-mention-user"&gt;Dawson16&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The Greg's answr is correct, just try it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;In Date Range? =
VAR MonthStart =
    EOMONTH ( 'Intersect'[Start Date], 0 )
VAR MonthFinish =
    EOMONTH ( 'Intersect'[Finish Date], 0 )
VAR MonthBeforeSnapshot =
    EOMONTH ( 'Intersect'[Snapshot Date], -1 )
RETURN
    IF (
        MonthBeforeSnapshot = MonthStart
            || MonthBeforeSnapshot = MonthFinish,
        "Yes",
        "No"
    )&lt;/LI-CODE&gt;&lt;P&gt;The idea is to compare end of month for each dates.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 21:42:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2765460#M85880</guid>
      <dc:creator>latimeria</dc:creator>
      <dc:date>2022-09-13T21:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect on Temporary Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2766918#M85973</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="151306" data-lia-user-login="latimeria" class="lia-mention lia-mention-user"&gt;latimeria&lt;/a&gt;&amp;nbsp;You beat me to it!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 10:25:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2766918#M85973</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-09-14T10:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect on Temporary Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2767868#M86026</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="151306" data-lia-user-login="latimeria" class="lia-mention lia-mention-user"&gt;latimeria&lt;/a&gt;, I must not have been following the DAX logic properly in Greg's original answer. I tried the longer formula posted above and it worked perfectly. Thank you both so much for helping me out with this! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 15:55:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2767868#M86026</guid>
      <dc:creator>Dawson16</dc:creator>
      <dc:date>2022-09-14T15:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect on Temporary Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2768308#M86069</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="151306" data-lia-user-login="latimeria" class="lia-mention lia-mention-user"&gt;latimeria&lt;/a&gt;&amp;nbsp;I just realized that the formulas above do not account for middle months if the activity spans more than two months. I believe I have found a solution to cover both instances, so I wanted to post it here for future guidance.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;In Date Range? = 
var ActivityListDates = DATESBETWEEN('Date'[Date],Table[Start Date],Table[Finish Date])
var PriorMonthListDates = DATESBETWEEN('Date'[Date],(EOMONTH(Table[Snapshot Date],-2)+1), EOMONTH(Table[Snapshot Date],-1))
	Return
IF(COUNTROWS(INTERSECT(PriorMonthListDates,ActivityListDates))&amp;gt;=1, "Yes", "No")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 21:11:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Intersect-on-Temporary-Tables/m-p/2768308#M86069</guid>
      <dc:creator>Dawson16</dc:creator>
      <dc:date>2022-09-14T21:11:07Z</dc:date>
    </item>
  </channel>
</rss>

