I'm trying to create a measure based on the solution you provided here, with a similar issue of the original poster., in that I want the latest, not the max on the latest date to be the result.
Am I correct in thinking the syntax for the measure you provided here is for the max price? How would I correct the following formula to give me just the latest?
Here's my example data:
Student ID; Package ID; sent_time
1; 1; 1/1/17
1; 2; 1/2/17
1; 4; 1/3/17
2; 2; 1/3/17
2; 4; 1/14/17
3; 1; 1/2/17
My two IDs are in text form. Want I want is a measure instead of a calculated column or table (I have two million rows and counting on this table, which has relationships with 4 other tables). So for this I would have Student ID 1, Package ID 4...Student ID2, Package ID 4, Student ID 3, Package ID 1 with only the Package IDs as the result.
I used your formula:
Stop ID = var cur_student_id = CONCATENATEX('Packages', 'Packages'[Student ID],",") var max_date = CALCULATE(MAX('Packages'[send_time]), FILTER(ALL('Packages'), 'Packages'[Student ID]=cur_student_id))
var result = CALCULATE(MAX('Packages'[Package ID]), filter(ALL('Packages'), AND('Packages'[send_time]=max_date, 'Packages'[Student ID]=cur_student_id)))
I don't get an error running the formula, but when I try to put the results in a report, it doesn't run through. I think the issue is this? var result = CALCULATE(MAX('Packages'[Package ID]),
since I don't want the MAX Package ID, just what the Latest Package ID is for the latest date.
I appreciate you answer and it is quite helpful, but I need something slightly different. Instead of the latest price I need to pull the latest text input. Any ideas on how to handle this with text instead of numbers