Forum Discussion
kattlees
Post Patron
7 years agoDAX help - Get latest value for each ID
I have a table (sample data below) that has Customer # Ans Code Date Entered Time Entered Answer What I am looking for is to get the LATEST answer nentered based on the Ans Code. In the exam...
- Anonymous7 years ago
Mh not that easy.
What you could try
1) duplicate your table
2) concatenate date and time
2) group by customer and ans code and find the Max date+time (this will generate a new table with only the row with max date for each customer+ans)
3) now use MERGE of these two tables using a inner join
SHOULD work, but have never tried
v-yulgu-msft
Microsoft Employee
7 years agoHi kattlees,
You can use a Matrix visual instead.
Add below measure to visual level filter and set its value to 1.
rank =
RANKX (
ALLEXCEPT ( 'Table', 'Table'[Customer #], 'Table'[Ans Code] ),
CALCULATE ( MAX ( 'Table'[Date Entered] ) + MAX ( 'Table'[Time Entered] ) ),
,
DESC,
DENSE
)
Best regards,
Yuliana Gu