Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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 &&
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
14 | |
10 | |
7 |