Forum Discussion

RemiAnthonise's avatar
7 years ago
Solved

DAX: current position > filter between 2 dates

Hi,   I need help with the following issue: We have a list with our employees. They work on a certain department (department = afdeling in my attached image below). Currently I see for my testper...
  • Greg_Deckler's avatar
    Greg_Deckler
    7 years ago

    You were referencing the wrong table:

    Current position = 
    
    VAR __naam = MAX('Workers'[Name])
    VAR __max = MAXX(FILTER(ALL('Positions'),[Name]=__naam),'Positions'[Start])
    RETURN IF(MAX('Positions'[Start])=__max,"Current","Ended")

    Attached. Also, your End column should really be a date field for this to work properly. Otherwise, as text, it is going to be wonky probably.