Forum Discussion
artp3642
4 years agoNew Member
How to filter latest dates using a measure?
I have the a table with many values for each date, and a column named type and other name type2 that distinguishes each record from each other. So it is:
| type1 | type2 | value | date |
| M_0 | conv | 5 | 14/02/2022 |
| M_0 | spread | 10 | 14/02/2022 |
| M_1 | conv | 15 | 14/02/2022 |
I tried to filter using the following code:
Medida = VAR ultima = CALCULATE ( MAX ( Table1[date] ), ALL ( Table1 ) ) RETURN IF ( MIN ( Table1[date] ) = maxDate, 1, 0 )
Unfortunately it doesnt work.
I also tried creating a column with value 1 on the latest date, and 0 elsewhere. But even adding a slicer and filtering it value dosn't work.
- Anonymous4 years ago
Hi artp3642 ,
you can try for
Medida = VAR ultima = CALCULATE(MAX(Table1[date]),ALL(Table1)) RETURN IF( Table1[date]) = ultima,1,0 )Regards,
Aditya
2 Replies
- AnonymousNot applicable
Hi artp3642 ,
you can try for
Medida = VAR ultima = CALCULATE(MAX(Table1[date]),ALL(Table1)) RETURN IF( Table1[date]) = ultima,1,0 )Regards,
Aditya - amitchandak
Super User
artp3642 , Try for column
Medida =
VAR ultima = CALCULATE MAX ( Table1[date] )
RETURN
IF (Table1[date] = maxDate, 1, 0 )what you have written is for a measure