Forum Discussion
Anonymous
6 years agoNot applicable
DAX
I have to pick the second max date associated territory for particular policy number from the multiple records
- 6 years ago
Anonymous , Try
Last Date = CALCULATE ( MAx ( territory [Date] ), ALLEXCEPT ( territory , territory [policy number] ) ) second max date = VAR __LAST = [First Purchase] RETURN CALCULATE ( MIN ( territory[Date] ), ALLEXCEPT ( territory , territory [policy number] ), Dates[Date] < __LAST )Or have Rank and filter for 2
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415
Ashish_Mathur
6 years agoSuper User
Hi,
Share a dataset and show the expected result.