Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Find value if date falls between START and END dates

Hi, I have below two tables and required output. If date from Table1 fall between Table2 START and END Dates, then i need name from Table2. Any leads will really help.   Table 1     Table2 ...
  • Greg_Deckler's avatar
    3 years ago

    Anonymous Try:

    Column =
      VAR __Date = 'Table 1'[Created Date]
      VAR __Name = MAXX(FILTER('Table2',__Date >= [Start Date] && __Date <= [End Date]),[Name])
    RETURN
      __Name
    
    
    Measure =
      VAR __Date = MAX('Table 1'[Created Date])
      VAR __Name = MAXX(FILTER('Table2',__Date >= [Start Date] && __Date <= [End Date]),[Name])
    RETURN
      __Name
  • Ashish_Mathur's avatar
    3 years ago

    Hi,

    Try this calculated column formula in Table1

    =CALCULATE(MAX(Table2[Name]),FILTER(Table2,Table2[Start Date]<=EARLIER(Table1[Created Date])&&Table2[End Date]>=EARLIER(Table1[Created Date])))

    Hope this helps.