<?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: Using a measure as a date column input in DATESINPERIOD in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4023357#M158783</link>
    <description>&lt;P&gt;Hi, thanks for the suggestion, but I am still getting the same error, I've solved this by using FILTER() instead&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2024 16:22:29 GMT</pubDate>
    <dc:creator>acamar22</dc:creator>
    <dc:date>2024-07-03T16:22:29Z</dc:date>
    <item>
      <title>Using a measure as a date column input in DATESINPERIOD</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4017365#M158395</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create some dynamic DAX code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR &lt;FONT color="#FF0000"&gt;DateRange&lt;/FONT&gt; = CALENDAR&lt;FONT color="#FF0000"&gt;(&lt;/FONT&gt; MIN('FailureData[Date]),&amp;nbsp; MAX&lt;FONT color="#000000"&gt;(&lt;/FONT&gt;'FailureData[Date]) &lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;CALCULATETABLE&lt;FONT color="#FF0000"&gt;(&lt;/FONT&gt; &lt;EM&gt;&lt;FONT color="#339966"&gt;other code&lt;/FONT&gt;&lt;/EM&gt; ,&amp;nbsp; DATESINBETWEEN( &lt;FONT color="#FF0000"&gt;DateRange&lt;FONT color="#000000"&gt;, StartDate, -1, MONTH)&amp;nbsp;&amp;nbsp; &lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;I am getting this error: &lt;U&gt;DatesINPeriod functions are only accepting date column reference as a first argument.&lt;/U&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;I tried to use SELECTCOLUMN() for DateRange, but I get the same result.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;I believe I just need to convert this single-column table into a column, but I'm not sure how. Any ideas? &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;Thanks&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2024 23:25:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4017365#M158395</guid>
      <dc:creator>acamar22</dc:creator>
      <dc:date>2024-06-30T23:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using a measure as a date column input in DATESINPERIOD</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4017371#M158396</link>
      <description>&lt;P&gt;Try with this below DAX code might help you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR DateRange =&lt;BR /&gt;CALENDAR(&lt;BR /&gt;MIN('FailureData'[Date]),&lt;BR /&gt;MAX('FailureData'[Date])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;CALCULATETABLE(&lt;BR /&gt;'OtherTable', -- Replace 'OtherTable' with your actual table name or expression&lt;BR /&gt;DATESINPERIOD(&lt;BR /&gt;DateRange,&lt;BR /&gt;MAX('FailureData'[Date]), -- End date of the period&lt;BR /&gt;-1, -- Number of intervals to go back (-1 means previous month)&lt;BR /&gt;MONTH -- Interval type (MONTH, QUARTER, YEAR)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2024 23:39:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4017371#M158396</guid>
      <dc:creator>VN999</dc:creator>
      <dc:date>2024-06-30T23:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using a measure as a date column input in DATESINPERIOD</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4017509#M158407</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="768436" data-lia-user-login="VN999" class="lia-mention lia-mention-user"&gt;VN999&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the response, however, this is what I already had.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main problem is that the VAR DateRange is not being accepted as the first input into DATESINPERIOD().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to figure out why and how to fix it.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 02:21:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4017509#M158407</guid>
      <dc:creator>acamar22</dc:creator>
      <dc:date>2024-07-01T02:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using a measure as a date column input in DATESINPERIOD</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4019481#M158563</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="639063" data-lia-user-login="acamar22" class="lia-mention lia-mention-user"&gt;acamar22&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="768436" data-lia-user-login="VN999" class="lia-mention lia-mention-user"&gt;VN999&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;very much for the solution, and&amp;nbsp;I've tried other ways to help you understand the problem:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;When you make a mistake with SELECTCOLUMN(), my advice is to use VALUES for this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR DateRange = CALENDAR(MIN('FailureData'[Date]), MAX('FailureData'[Date]))
RETURN
CALCULATETABLE(
   'OtherTable',  // Replace with your actual table name or expression
   DATESINBETWEEN(
       VALUES(DateRange[Date]),  // This is a date column reference
       StartDate,  // 
       EDATE(StartDate, -1)  // 
   )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Hope it helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_ Tom Shen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 02:29:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4019481#M158563</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-02T02:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using a measure as a date column input in DATESINPERIOD</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4023357#M158783</link>
      <description>&lt;P&gt;Hi, thanks for the suggestion, but I am still getting the same error, I've solved this by using FILTER() instead&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 16:22:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-date-column-input-in-DATESINPERIOD/m-p/4023357#M158783</guid>
      <dc:creator>acamar22</dc:creator>
      <dc:date>2024-07-03T16:22:29Z</dc:date>
    </item>
  </channel>
</rss>

