<?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 Measure in DATESBETWEEN Function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measure-in-DATESBETWEEN-Function/m-p/3321028#M124297</link>
    <description>&lt;P&gt;Thank You&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340078" data-lia-user-login="WinterMist" class="lia-mention lia-mention-user"&gt;WinterMist&lt;/a&gt; for the reply my issue is I need a dynamic date picked by the user used instead of TODAY() that way they can generate a report from any given date with plus or minus date ranges at will. I hope I am making sense.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2023 21:41:23 GMT</pubDate>
    <dc:creator>DennisG</dc:creator>
    <dc:date>2023-07-07T21:41:23Z</dc:date>
    <item>
      <title>Using Measure in DATESBETWEEN Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measure-in-DATESBETWEEN-Function/m-p/3320848#M124280</link>
      <description>&lt;P&gt;My question is can I use a measure in the DATESBETWEEN dax function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using TODAY() this works just fine I can slice by any date range. I would like to substitute a measure for TODAY(). The measure would be a selected date from a separate calendar table example&lt;/P&gt;&lt;P&gt;TargetDate = SELECTEDVALUE(CalendarDynamicTarget[Date]) I simply want to&lt;/P&gt;&lt;P&gt;I simply want to allow the user to pick a single date and have the period table use that date as the Target Date and create date ranges plus or minus that date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a calculated table defined like this&lt;/P&gt;&lt;P&gt;Period =&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;VAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;_Next30Days = ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CALCULATETABLE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Calendar'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ,DATESBETWEEN('Calendar'[Date],[TargetDate], &amp;nbsp;[TargetDate]+30)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ,"In the Next", "a_1 to 30 Days","ColorYN",0&lt;/P&gt;&lt;P&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;VAR &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_Next60Days = ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CALCULATETABLE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Calendar'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ,DATESBETWEEN('Calendar'[Date],TODAY()+31, &amp;nbsp;TODAY()+60)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; , "In the Next", "b_31 to 60 Days","ColorYN",0&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;VAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_Next90Days =&lt;/P&gt;&lt;P&gt;ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; CALCULATETABLE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; 'Calendar'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ,DATESBETWEEN('Calendar'[Date],TODAY()+61, TODAY()+90)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; , "In the Next", "c_61 to 90 Days","ColorYN",0&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 17:11:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measure-in-DATESBETWEEN-Function/m-p/3320848#M124280</guid>
      <dc:creator>DennisG</dc:creator>
      <dc:date>2023-07-07T17:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using Measure in DATESBETWEEN Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measure-in-DATESBETWEEN-Function/m-p/3321025#M124296</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="295769" data-lia-user-login="DennisG" class="lia-mention lia-mention-user"&gt;DennisG&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure why, but DATESBETWEEN doesn't seem to work for me either.&lt;/P&gt;&lt;P&gt;However, you can use GENERATESERIES to return the period of desired dates based on the [Target Date] selected from the slicer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;NOTE: I used a range of the last 10 days (including today), but this is arbitrary.&amp;nbsp; Use any range you like.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps someone else may know why DATESBETWEEN returns no records in this situation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully GENERATESERIES works for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 21:33:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measure-in-DATESBETWEEN-Function/m-p/3321025#M124296</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2023-07-07T21:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Measure in DATESBETWEEN Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measure-in-DATESBETWEEN-Function/m-p/3321028#M124297</link>
      <description>&lt;P&gt;Thank You&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340078" data-lia-user-login="WinterMist" class="lia-mention lia-mention-user"&gt;WinterMist&lt;/a&gt; for the reply my issue is I need a dynamic date picked by the user used instead of TODAY() that way they can generate a report from any given date with plus or minus date ranges at will. I hope I am making sense.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 21:41:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measure-in-DATESBETWEEN-Function/m-p/3321028#M124297</guid>
      <dc:creator>DennisG</dc:creator>
      <dc:date>2023-07-07T21:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using Measure in DATESBETWEEN Function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measure-in-DATESBETWEEN-Function/m-p/3321038#M124298</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="295769" data-lia-user-login="DennisG" class="lia-mention lia-mention-user"&gt;DennisG&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My apologies for the screenshots still referring to TODAY().&lt;/P&gt;&lt;P&gt;It's the same solution.&lt;/P&gt;&lt;P&gt;You just replace it with the dynamic measure and it works, as long as you're using GENERATESERIES.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;NOTE: I only added the CountRowsInPeriod VAR so that it would return a scalar value for testing.&amp;nbsp; If you're returning the table, then you'll need to use it in another way (e.g. as a filter argument or something).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 22:01:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measure-in-DATESBETWEEN-Function/m-p/3321038#M124298</guid>
      <dc:creator>WinterMist</dc:creator>
      <dc:date>2023-07-07T22:01:15Z</dc:date>
    </item>
  </channel>
</rss>

