Forum Discussion
Charlie42
4 years agoFrequent Visitor
Filter a table to keep the last date
Helle everyone,
I have a table like that:
| doc | Val | Date |
| doc1 | Val1 | 01/01/2022 |
| doc1 | Val1 | 01/03/2022 |
| doc2 | Val2 | 01/01/2022 |
| doc2 | Val2 | 01/02/2022 |
| doc3 | val3 | 01//02/2022 |
With a DAX function, I look for create a new column (or new table) to filter each row with the last date and to have this new table :
| doc | Val | Last Date |
| doc1 | Val1 | 01/03/2022 |
| doc2 | Val2 | 01/02/2022 |
| doc3 | val3 | 01//02/2022 |
I look with LASTDATE but I'm not able to find a good (and working) solution.
Could you help me ?
Thank in advance
Charlie42 sure
Table = FILTER ( tbl, tbl[Date] = CALCULATE ( MAX ( tbl[Date] ), ALLEXCEPT ( tbl, tbl[doc], tbl[Val] ) ) )