Forum Discussion
Lookup value if date is between two dates
- Anonymous7 years ago
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.
Try this
CreatedInSprint = var __date = WorkItems[fields_SystemCreatedDate] return MAXX( FILTER( Sprints; AND( Sprints[attributes_startDate] <= __date, __date <= Sprints[attributes_finishDate] ) ), Sprints[SprintNo] )
This should work correctly on the assumption that there is always at most one sprint returned by the logical condition in FILTER. If there happen to be many, then the maximum SprintNo will be returned.
Best
Darek
Hi @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 and([DELNOTE_DATE]>=[date_from],[DELNOTE_DATE]<=[date_to]) but i just get all true results. I have hard coded the date using and([DELNOTE_DATE]>=date(2021,11,22),[DELNOTE_DATE]<=date(2021,12,26)) and this works perfectly? AlI columns are set as date. Any help/guidance would be appreciated.