Forum Discussion
RemiAnthonise
7 years agoHelper V
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...
- 7 years ago
Huh, I hate saying this but, works for me. See attached, Page 1, Table3
- 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.
RemiAnthonise
7 years agoHelper V
Hi Greg Greg_Deckler
Sorry to bother you with my problems (again) but if you have some time to check it out: this would be very nice.
Thanks a lot!
Greg_Deckler
7 years agoCommunity Champion
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.
- RemiAnthonise7 years agoHelper V
I think I've got it working. Thanks Greg Greg_Deckler ,I'll mark your answer as solution.
If I'm still having troubles I'll let you know!