<?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: Lookup value if date is between two dates in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/993477#M12391</link>
    <description>Nope. The Date hierarchy that's generated by Power BI automatically should NEVER be relied upon but in the simplest of models. If you have a decent model and want to keep your sanity, you should never rely on this functionality. It's for newbies who have no idea what a good model is and what good DAX means. So, please stay away from it. You should always, ALWAYS, have a calendar of your own with all the entities defined in it. The functionality to create an automatic hierarchy can be switched no/off in the settings of the file or globally. My strong suggestion is to turn it off forever and forget it has ever existed. There are numerous YT videos by Marco Russo and Alberto Ferrari that say you should forget this functionality unless... you like asking for troubles. Make you own calendar and you'll be safe.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
    <pubDate>Thu, 26 Mar 2020 14:13:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-26T14:13:48Z</dc:date>
    <item>
      <title>Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/742143#M2317</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to PowerBI and the DAX syntax.&lt;BR /&gt;&lt;BR /&gt;I have 2 tables (Sprints and WorkItems). All date columns are formatted as &lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sprints table: (columns StartDate, FinishDate and SprintNumber)&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;WorkItems table: (columns CreatedDate and CreatedInSprintNumber)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am trying to test if the &lt;STRONG&gt;CreatedDate&lt;/STRONG&gt; from WorkItems falls within the date range (&lt;STRONG&gt;Start&lt;/STRONG&gt; and &lt;STRONG&gt;Finish&lt;/STRONG&gt;) in Sprints and then return the SprintNumber.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;U&gt;&lt;STRONG&gt;I searched for a solution and found this expression:&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CreatedInSprint = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SUM(Sprints[SprintNo]);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;FILTER(Sprints;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Sprints[attributes_startDate] &amp;lt;= WorkItems[fields_SystemCreatedDate] &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Sprints[attributes_finishDate] &amp;gt;= WorkItems[fields_SystemCreatedDate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;However, - as you can see it only returns some of the sprint numbers (the ones matching&amp;nbsp;&lt;STRONG&gt;Finish&lt;/STRONG&gt; date)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can anyone see what I am doing wrong?&lt;/DIV&gt;</description>
      <pubDate>Wed, 17 Jul 2019 11:59:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/742143#M2317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-17T11:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/742686#M2351</link>
      <description>&lt;P&gt;I don't think you've told us all about the model... I suspect there are relationships between the two tables based on the date fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;CreatedInSprint =
var __date = WorkItems[fields_SystemCreatedDate]
return
	MAXX(
		FILTER(
			Sprints;
			AND(
		    	Sprints[attributes_startDate] &amp;lt;= __date,
		    	__date &amp;lt;= Sprints[attributes_finishDate]
		    )
		),
		Sprints[SprintNo]
	)&lt;/PRE&gt;&lt;P&gt;This should work correctly on the assumption that there is always &lt;STRONG&gt;at most one&lt;/STRONG&gt; sprint returned by the logical condition in FILTER. If there happen to be many, then the maximum SprintNo will be returned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 22:38:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/742686#M2351</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-17T22:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/744390#M2438</link>
      <description>&lt;P&gt;Hi Darek&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your rapid reply. Your assumption was correct and it works out of the box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to follow-up on the model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following relationships exist (between&amp;nbsp;&lt;U&gt;Dates&lt;/U&gt; and&amp;nbsp;&lt;U&gt;Sprints&lt;/U&gt;) and (between&amp;nbsp;&lt;U&gt;Dates&lt;/U&gt;&amp;nbsp;and&amp;nbsp;&lt;U&gt;WorkItems&lt;/U&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From&amp;nbsp;&lt;STRONG&gt;date&lt;/STRONG&gt; in &lt;U&gt;Dates&lt;/U&gt;&amp;nbsp;to &lt;STRONG&gt;attributes_startDate&lt;/STRONG&gt; in &lt;U&gt;Sprints&lt;/U&gt; (1:*) and (cross filter direction: Both)&lt;/P&gt;&lt;P&gt;From&amp;nbsp;&lt;STRONG&gt;date&lt;/STRONG&gt; in &lt;U&gt;Dates&lt;/U&gt;&amp;nbsp;to &lt;STRONG&gt;attributes_finishDate&lt;/STRONG&gt; in &lt;U&gt;Sprints&lt;/U&gt; (1:*) and (cross filter direction: Both)&lt;/P&gt;&lt;P&gt;From&amp;nbsp;&lt;STRONG&gt;date&lt;/STRONG&gt; in &lt;U&gt;Dates&lt;/U&gt;&amp;nbsp;to &lt;STRONG&gt;fields_SystemCreatedDate&lt;/STRONG&gt; in &lt;U&gt;WorkItems&lt;/U&gt;&amp;nbsp; (1:*) and (cross filter direction: Both)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2019 10:09:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/744390#M2438</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-19T10:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/744398#M2439</link>
      <description>&lt;P&gt;I want to warn you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Be extremely careful with a model that has both-ways cross-filtering enabled. This is very DANGEROUS and you may end up calculating things you won't understand. The best people in the world of DAX say that both-ways cross-filtering should be enabled IF AND ONLY IF it's strictly necessary and when you understand all the consequences. I'd advise that you revise your model and remove cross-filtering as much as possible. If the model becomes at one point ambiguous (because, for instance, you add some tables to it and create relationships) and the engine does not detect it (which is not uncommon), then &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;you'll be in deep trouble&lt;/STRONG&gt;&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;You've been warned.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2019 10:16:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/744398#M2439</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-19T10:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/744421#M2441</link>
      <description>&lt;P&gt;I see, thank you for the insights on this topic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will change my model with this in mind.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2019 11:10:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/744421#M2441</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-19T11:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/990709#M12296</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;Could you pls advise for a similar issue?&lt;/P&gt;&lt;P&gt;1st table is a typical Calendar table (column Date is of interest).&lt;/P&gt;&lt;P&gt;2nd table has the following columns: Opportunity ID, Opp Start Date, Opp Close Date, Opp value.&lt;/P&gt;&lt;P&gt;I want to get the cumulative value of &lt;U&gt;valid&lt;/U&gt; Opportunities at 'Calendar'[Date] hierarchy. An Opportunity is considered valid when Date is between the Opp Start Date and the Opp Close Date.&lt;/P&gt;&lt;P&gt;Thank you for your effort.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 10:10:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/990709#M12296</guid>
      <dc:creator>Thimios</dc:creator>
      <dc:date>2020-03-25T10:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/990842#M12300</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;// Calendar can be connected via Date
// to any or both of the columns in Opportunities.
// This does not matter for this calculation.
// If there are any relationships, the
// CROSSFILTER function will remove the
// relationships. If there are no relationships
// you might need to remove the function from
// the code. Assumption is that each opportunity
// has a start date and a close date that's not
// blank. If an opportunity is still valid today
// the end date will be, say, coded as 3000-01-01.
// No blanks allowed. BLANKS will complicate the
// code and make it slower.

[Valid Opp Count] =
var __dateSelected = SELECTEDVALUE( Calendar[Date] )
var __isDateDirectlyFiltered = ISFILTERED( Calendar[Date] )
var __count =
	CALCULATE(
		Opportunities,
		Opportunities[Start Date] &amp;lt;= __dateSelected,
		__dateSelected &amp;lt;= Opportunities[End Date]
		
		// If you allow End Date to be blank, then you
		// have to add this to the above expression
		
		// || ISBLANK( Opportunities[End Date] )
		
		// Out of the two select the correct one
		// or remove them if there is no relationship
		// from Date to these columns.
		CROSSFILTER( 'Calendar'[Date], Opportunities[Start Date], NONE ),
		CROSSFILTER( 'Calendar'[Date], Opportunities[End Date], NONE )
	)
return
	if( __isDateDirectlyFiltered, __count )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 11:09:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/990842#M12300</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-25T11:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/991822#M12348</link>
      <description>&lt;P&gt;Thank you Anonymous&lt;/LI-USER&gt;&amp;nbsp; for your ideas. I've done some testing but I didn't manage to get any results.&lt;/P&gt;&lt;P&gt;Do you mind taking a look at the sample pbix file here?&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/open?id=1nZGsdNwTTDNcyrjDmnPJxdl589M1C5fk" target="_self"&gt;https://drive.google.com/open?id=1nZGsdNwTTDNcyrjDmnPJxdl589M1C5fk&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 21:28:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/991822#M12348</guid>
      <dc:creator>Thimios</dc:creator>
      <dc:date>2020-03-25T21:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/991966#M12353</link>
      <description>&lt;P&gt;Hi there. I've done some work on this but I'm too tired right now to make it the way it should be. I've noticed that, for instance, the calendar does not handle missing dates properly. Dates should be handled in such a way that when there's no date, BLANK is not left in such a field but a dedicated date (e.g., 3000-01-01) as assigned to it and this date is present in the Calendar as well. The real Date field in the Calendar should be hidden and a date-like text should be presented to the user. The special dates that handle missing dates should have a label like Unknown or maybe 'Not Started' or 'Not Finished'... Something of this kind. But BLANKS should be avoided as much as possible because they make calculations not only more complex but also slower. Having said all that... I attached a file with what you wanted. Please take a look at how I handled the opportunities that do not have a start date. If an opportunity does not have a start date, it means this opportunity does not exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 00:37:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/991966#M12353</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-26T00:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/993437#M12386</link>
      <description>&lt;P&gt;Great advice Anonymous&lt;/LI-USER&gt;, thank you!&lt;/P&gt;&lt;P&gt;I made all necessary changes as far as Calendar is concerned and results are verified on day basis.&lt;/P&gt;&lt;P&gt;I've noticed though that Date Hierarchy is not available to use in the visual. Is filtering inside the '# Opportunities' measure responsible for that?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 13:41:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/993437#M12386</guid>
      <dc:creator>Thimios</dc:creator>
      <dc:date>2020-03-26T13:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/993477#M12391</link>
      <description>Nope. The Date hierarchy that's generated by Power BI automatically should NEVER be relied upon but in the simplest of models. If you have a decent model and want to keep your sanity, you should never rely on this functionality. It's for newbies who have no idea what a good model is and what good DAX means. So, please stay away from it. You should always, ALWAYS, have a calendar of your own with all the entities defined in it. The functionality to create an automatic hierarchy can be switched no/off in the settings of the file or globally. My strong suggestion is to turn it off forever and forget it has ever existed. There are numerous YT videos by Marco Russo and Alberto Ferrari that say you should forget this functionality unless... you like asking for troubles. Make you own calendar and you'll be safe.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Thu, 26 Mar 2020 14:13:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/993477#M12391</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-26T14:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/2237590#M53487</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous, would you be able to help with a similar question. I have a delivery note date that i wish to determine is within my period dates, (From and To) which are in the same table. I have tried the regular DAX expression of&amp;nbsp; and([DELNOTE_DATE]&amp;gt;=[date_from],[DELNOTE_DATE]&amp;lt;=[date_to]) but i just get all true results. I have hard coded the date&amp;nbsp;&lt;SPAN&gt;using and&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[DELNOTE_DATE]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN&gt;date&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;2021&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;11&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;22&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;[DELNOTE_DATE]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN&gt;date&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;2021&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;12&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;26&lt;/SPAN&gt;&lt;SPAN&gt;)) and this works perfectly? AlI columns are set as date. Any help/guidance would be appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 09:42:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/2237590#M53487</guid>
      <dc:creator>Krd603206</dc:creator>
      <dc:date>2021-12-14T09:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/2238411#M53536</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous, would you be able to help with a similar question. I have a table in which i am looking to return true/false for a date which comes after the Date_from column and before the Date_until column date. I have tried a regular DAX expression of&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;InRangeDate = &lt;/SPAN&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DELNOTES[DELNOTE_DATE]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN&gt;DELNOTES[DATE_FROM]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DELNOTES[DELNOTE_DATE]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN&gt;DELNOTES[DATE_UNTIL]&lt;/SPAN&gt;&lt;SPAN&gt;) but this only returns TRUE in all instances. I have then tried to hard code the date for a given accounting period using this expression&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;InRange = &lt;/SPAN&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DELNOTES[DELNOTE_DATE]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN&gt;date&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;2021&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;11&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;22&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;DELNOTES[DELNOTE_DATE]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN&gt;date&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;2021&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;12&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;26&lt;/SPAN&gt;&lt;SPAN&gt;)) - this works perfectly, but is not dyamic. The issue appears to be with the calculation but am at a loss as to how to get around it. Any help would be most helpful.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Dec 2021 15:31:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/2238411#M53536</guid>
      <dc:creator>Krd603206</dc:creator>
      <dc:date>2021-12-14T15:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup value if date is between two dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/2530140#M70942</link>
      <description>&lt;P&gt;&amp;nbsp;&amp;nbsp;I’m trying to create a formula to show the QBEstimate.Monthlyfee for the righg billing period&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My qBEstimate Table has a QBEstimate.EsStartDate, QBEstimate.EsEndDate and monthly fee. I’m trying to create &amp;nbsp;a matrix to show the fee by TDate.Billing Month&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know the problem is in my relationships but I can’t set the set QBEstimate.EsStartDate and QBEstimate.EsEndDate to the &amp;nbsp;TDate.Billing Month&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my measure – it returns te right values for some months but not all.&lt;/P&gt;&lt;P&gt;DAX measure&lt;/P&gt;&lt;P&gt;MSSMonthlyFees =&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(QBEstimate[MonthlyFee]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILTER(QBEstimate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QBEstimate[EsStartDate] &amp;lt;= min(TDate[Billing Month]) &amp;amp;&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QBEstimate[EsEndDate] &amp;gt;= max(TDate[Billing Month])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All help welcome&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TDATE Table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TDate = ADDCOLUMNS(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALENDAR(date(2021,1,1), date(2022,12,31)),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Month", FORMAT([Date],"mmm YY"),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "MonthOrder",&amp;nbsp; MONTH([Date]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Year",YEAR([Date]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Week", WEEKNUM([Date]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "WeekYear", concatenate(YEAR([Date]),WEEKNUM([Date])),&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Billing Month",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VAR DayNumber = WEEKDAY ( [Date], 1 ) RETURN IF(DayNumber = 7,[Date] - 1, [Date] + 6 - DayNumber)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;QBEstimate Table&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Id&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;CustomerRef_Value&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;EsStartDate&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;ESEndDate&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;MonthlyFee&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&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&lt;TD&gt;&lt;P&gt;8/22/2020&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;10/22/2022&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;$15,578.81&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 18:08:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-value-if-date-is-between-two-dates/m-p/2530140#M70942</guid>
      <dc:creator>ctedesco3307</dc:creator>
      <dc:date>2022-05-20T18:08:30Z</dc:date>
    </item>
  </channel>
</rss>

