Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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 can't go into the details, the data is proprietary... This is a mock-up of only what I need, and only 3 subjects.
Solved! Go to Solution.
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:
Proud to be a Super User!
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:
Proud to be a Super User!
perfection, thank you!
Hi,
you could try something like this: