Forum Discussion
Anonymous
3 years agoNot applicable
Calculated Column by Other Column
Hi all, I'm having trouble coding this column... my data behaves like this: and I want to add a new column that will return the Event with the max date, per Subject like this: I ca...
- 3 years ago
Hi, Anonymous
I tried to reproduce the problem.
I used the dax below
Max Event = VAR CurrentSubject = Table1[Subject] VAR MaxDate = CALCULATE( MAX(Table1[Event Date]), FILTER( Table1, Table1[Subject] = CurrentSubject ) ) RETURN CALCULATE( MAX(Table1[Event]), FILTER( Table1, Table1[Subject] = CurrentSubject && Table1[Event Date] = MaxDate ) )result:
rubayatyasmin
3 years agoCommunity Champion
Hi, Anonymous
I tried to reproduce the problem.
I used the dax below
Max Event =
VAR CurrentSubject = Table1[Subject]
VAR MaxDate =
CALCULATE(
MAX(Table1[Event Date]),
FILTER(
Table1,
Table1[Subject] = CurrentSubject
)
)
RETURN
CALCULATE(
MAX(Table1[Event]),
FILTER(
Table1,
Table1[Subject] = CurrentSubject && Table1[Event Date] = MaxDate
)
)
result:
Anonymous
3 years agoNot applicable
perfection, thank you!