Forum Discussion
Pierre_B
3 years agoNew Member
Create a max date measure for each id
Hi everyone, I would like to create a measure using dax in order to get the max date for each id and filtered date, and keeping the every date in my table. date id max date 01/01/2022...
Pierre_B
3 years agoNew Member
This is what I tried but I get this message:
"Expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."
It is always what I get when I combine filter on selected dates and IDs...
Barthel
Solution Sage
3 years agoTry using a variable. For me that seems to do the trick.
max date =
VAR _dates =
ALLSELECTED ( 'Table'[date] )
VAR _result =
CALCULATE (
MAX ( 'table'[date] ),
REMOVEFILTERS ( 'Table' ),
VALUES ( 'Table'[id] ),
_dates
)
RETURN
_result