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.
I have a fact table with events, a date table, and a person table. I am trying to write a measure that returns the most recent event for each employee. Having trouble, any help appreciated. Below is what I have started..
hi @PompanoPete ,
Hi, @PompanoPete
try below
_most recent Event =
var a = calculate(max('Date'[Full Date]),allexcept('Person','Person'[Employee Number]))
CALCULATE (
MAX ( vFactEmployeeEvent[Event Name] ),
FILTER (
ALL ( vFactEmployeeEvent ),
'Date'[Full Date] = a,
'Person'[Employee Number] = 'Person'[Employee Number]
)
)
I added a return before calculate. Here is the latest.
getting error stating cannot find ful Date.. I seem to get this allot and tried using related but no luck.
I tried returning just the variable a, which evaluated without error, but instead of getting the max date, I just got full date and the number of rows for Employee1 jumped from 11 to hundreds. I suspect one for each row in the fact table. Thanks for the response. Below is sample data.
_most recent Event =
var a = calculate(max('Date'[Full Date]),allexcept('Person','Person'[Employee Number]))
CALCULATE (
MAX ( vFactEmployeeEvent[Event Name] ),
FILTER (
ALL ( vFactEmployeeEvent ),
'Date'[Full Date] = a &&
'Person'[Employee Number] = 'Person'[Employee Number]
)
)
Hi, @PompanoPete
replace ( , ) with &&