The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
16 | |
8 | |
7 | |
6 | |
5 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |